Hi, I have this error when I try of consum my api, How can I solve?

|
DesolatorMagno 2021-06-16 16:08:26
Fortify is only the back, they choice to separate front and back.
DesolatorMagno 2021-06-16 16:08:37
https://laravel.com/docs/8.x/fortify
SureshLaraDev 2021-06-16 16:08:53
DesolatorMagno 2021-06-16 16:08:26
Fortify is only the back, they choice to separate front and back.

Yes

SureshLaraDev 2021-06-16 16:09:36
https://youtube.com/playlist?list=PLxFwlLOncxFIbxi2gQCN3SR5e3-WB-4T2

Laravel Fortify – Create your own Laravel 8 login system – YouTubeYouTube
SureshLaraDev 2021-06-16 16:17:39
Marvixino 2021-06-16 08:49:29
The laravel/ui will not be supported soon, and fortify not supports stateless auth, I want to use use sanctum

Laravel 8 REST API With Sanctum AuthenticationYouTube
Beginner-friendly REST API from scratch using Laravel 8. We will implement authentication using API keys with Laravel Sanctum.

Code:
https://github.com/bradtraversy/laravel-sanctum-api

Laravel Sanctum Docs:
https://laravel.com/docs/8.x/sanctum

Timestamps:
0:00 – Intro
1:46 – Set Up Laravel
3:23 – SQLite Setup
4:15 – Basic Routing
6:38 – Product Model & Migration
10:56 – Using the Model
14:39 – Product Controller & Methods
17:30 – Create Products & Validation
21:53 – Single Product & Resource Routes
24:05 – Update Product
25:32 – Delete Product
26:54 – Search Products
29:48 – Sanctum Setup
33:22 – Protecting Routes
38:38 – Auth Controller
39:05 – Register User & Get Token
45:30 – Logout & Delete Token
48:00 – Login User & Get Token

Soumen954 2021-06-16 18:37:37
Cannot declare class AppHttpControllersMessagesController, because the name is already in use
Soumen954 2021-06-16 18:37:49
how to solve this
Safarnama9600 2021-06-16 18:40:41
How to use Ajax in laravel? Any tutorial recommendation
Bhavyakumar Panchotiya 2021-06-16 19:17:59
laravel_discuss-85488.jpg
Can anyone tell me how to solve this
albertocardenas 2021-06-16 19:25:17
You have the solution on the screen
likemind021 2021-06-16 19:25:25
Soumen954 2021-06-16 18:37:37
Cannot declare class AppHttpControllersMessagesController, because the name is already in use

Controller with that name already exist

albertocardenas 2021-06-16 19:25:27
Install or update phpspreadsheet
unknownstranges 2021-06-16 19:42:20
<form method=”POST” action=”{{ route(‘storeCompany’) }}”>
@csrf
<select class=”form-control” name=”category_id”>
@foreach( $categories as $c )
<option value=”{{ $c->id }}” @if(old(‘category_id’) == $c->id) selected @endif>{{ $c->name }}</option>
@endforeach
</select>
<!–<label>{{ __(‘URL 1’) }}</label>
<input type=”text” name=”url” value=”{{ old(‘url’) }}” class=”form-control”>–>
<!–<label>{{ __(‘URL 2’) }}</label>
<input type=”text” name=”url” value=”{{ old(‘url’) }}” class=”form-control”>–>
<input type=”submit” name=”sbNewReviewItem” value=”{{ __(‘Submit’) }}”>
</form>

I want to show as <label>{{ (‘URL 1’) }}</label> when $c->id is 26 and <label>{{ (‘URL 2’) }}</label> when $c->id is 27. How can I achieve this?

DesolatorMagno 2021-06-16 19:44:50
You can try using a custom attribute.
albertocardenas 2021-06-16 19:48:15
Use https://carbon.now.sh to copy your code

carbon.now.sh
Carbon is the easiest way to create and share beautiful images of your source code.
favourebrusi 2021-06-16 20:13:00
laravel_discuss-85496.jpg
i want to pass database value and send via sms, i need help
Marcelo Alvarez 2021-06-16 20:14:55
laravel_discuss-85497.jpg
hi, I have this error when I try of consum my api , How can I solve? please
favourebrusi 2021-06-16 20:17:00
Marcelo Alvarez 2021-06-16 20:14:55
hi, I have this error when I try of consum my api , How can I solve? please

is your product_id auto increment

Marcelo Alvarez 2021-06-16 20:17:54
laravel_discuss-85499.jpg
no
Marcelo Alvarez 2021-06-16 20:19:31
is an fk
favourebrusi 2021-06-16 20:19:49
Marcelo Alvarez 2021-06-16 20:17:54
no

that why you are having the error

Marcelo Alvarez 2021-06-16 20:20:11
I don’t know
Marcelo Alvarez 2021-06-16 20:20:21
General error: 1364 Field ‘product_id’ doesn’t have a default value
Marcelo Alvarez 2021-06-16 20:20:43
return that error
albertocardenas 2021-06-16 20:20:44
$producto or $prodct?
favourebrusi 2021-06-16 20:20:56
make product_id auto increment
albertocardenas 2021-06-16 20:21:12
On the faker, you type $producto with O
albertocardenas 2021-06-16 20:21:34
$producto->id I think you want to say $product->id
Marcelo Alvarez 2021-06-16 20:21:43
albertocardenas 2021-06-16 20:20:44
$producto or $prodct?

is $producto its in spanish

albertocardenas 2021-06-16 20:22:28
And where is the $product->id? What is the way that you get?
albertocardenas 2021-06-16 20:23:37
Sorry I see it is on the foreach
albertocardenas 2021-06-16 20:24:17
check with a $dd($producto) to see if you get it correctly the $product_id
Marcelo Alvarez 2021-06-16 20:25:19
I found the error, thanks for your help
albertocardenas 2021-06-16 20:25:41
good!
natghi2010 2021-06-16 20:53:50
laravel_discuss-85515.jpg
Hi, I am trying to seed some data and I cant seem to understand the error. Maybe im not seeing something?
|