Skip to content
Advertisement

Tag: laravel-5.5

Laravel 5.5 BelongsToMany with pivot conditions

I have three models, Clinic, Department and ClinicDepartment and has belongsToMany relation called departments from Clinic to Department using ClinicDepartment’s table as pivot table, but when i using this relation, scopes from ClinicDepartment not aplying in query. I decided to make Pivot model calling ClinicDepartmentPivotand apply those scopes to Pivot, but no luck. Clinic model: Department Model: ClinicDepartmentPivot Model: ActiveOnlyScope:

Laravel dump() unexpected output

Using Laravel 5.5.34, I have trouble outputting debug information in Blade templates using the dump() helper. results in the following output: I wouldn’t expect the raw string “test” to show up below the actual debug output. Is this the normal behavior and if yes, how can I disable it? If no, what misconfiguration could cause it? Answer Digging a little

Why is broadcasting/auth not found?

Already uncommented at config/app.php: and Error: I am using Mamp 4 and Laravel 5.5. Answer Try this commands php artisan config:cache composer require pusher/pusher-php-server “~2.6” (user 2.6 because 3.0 has class Pusher not found issue) composer update (just to make sure everything is up to date) php artisan config:cache (do it again)

Laravel 5.5 login and register page says:The page has expired due to inactivity.[TokenMismatchException]

I just created a new project of laravel version 5.5 with the laravel installer.And run the command “php artisan make:auth”.The views and controller are generated for the user authentication.And also run “php artisan migrate” to create tables needed in the database.When visiting the login page and register page,filling the form and submit.It shows “The page has expired due to inactivity.

Laravel 5: php artisan migrate:refresh

I am working on a laravel project and each time I change my table (add or remove column) and run php artisan migrate:refresh. I get this error: [SymfonyComponentDebugExceptionFatalErrorException] Can’t use method return value in write context Solution tried: run composer dump-autoload (Fails) Drop table in database, delete the migration file and restart again (works) Previous migration file: Changed migration file:

Advertisement