skip to Main Content

Why when i use primary modifier in laravel I get error?

Hi friends This is my code in laravel: Schema::create('programmer', function (Blueprint $table) { $table->id(); $table->string('email', 155)->unique(); $table->integer('primary')->primary(); $table->timestamps(); }); I got this error: SQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key defined (Connection: mysql, SQL: alter table programmer…

VIEW QUESTION

Laravel – Attempt to read property "id" on bool (View: D:websiteImageresourcesviewslayout.blade.php), variable not transfering to view

I keep encountering this error on Laravel 8 with PHP 8. Im grabbing the id from the view like so: <li><a href="category/{{$catego->id}}">{{$catego->categories}}</a></li> This then goes to web.php like so: Route::get('category/{id}', [UserController::class, 'categories']); It then goes to the categories function like…

VIEW QUESTION

Laravel Custom Requqest Is not woring

So I was trying to use Laravel custom request, following the documentation: api.php Route::post('/register-user', [AuthController::class, 'register']); AuthController.php: namespace AppHttpControllers; use AppHttpRequestsTestRequest; use IlluminateRoutingController as BaseController; class AuthController extends BaseController { /** * Register a new user * @param TestRequest $request…

VIEW QUESTION
Back To Top
Search