Category "laravel"

why is Blade code getting rendered on the page?

I just started learning Laravel, Installed Laravel 7.6.2, and PHP 7.4.4 Without modifying a single line of code in the entire Laravel project, I try to open the

how to create global function that can be accessed from any controller and blade file

I have two controller file homecontroller and backendcontroller. What is the best way to create global function and access it from both files? I found here Ar

Laravel - Browser displays message again when I press back button

Every time I create a new category in my application, it displays a message of success. Here is my code: return redirect('dashboard/categorias')->with('mess

How to run multiple Laravel projects at same time?

To run one laravel project we only need to type "php artisan serve". and it will be available on port 8000. But sometimes we need to run multiple projects at t

Laravel dosen't connect with Oracle

I'm using yajra/laravel-oci8 for Oracle connection with laravel. But I couldn't connected to Oracle, from my client PC to Server. showing this error: I'm u

Laravel Echo + Laravel Passport auth in private / presence websockets channels

I'm trying to connect to a presence wesocket channel using Laravel Echo. I'm also using Laravel Passport. I followed lots of tutorials, but I'm getting 403 erro

How to access Sanctum package in custom laravel package

i want to access laravel sanctum auth which is working fine in project routes I'm making a custom package of api's which needs to use same sanctum authenticatio

Can't run Node.js server local

I can't npm run watch I don't know the problem

Laravel actingAs guest

Laravel provides a way to authenticate a given user during HTTP testing with $this->actingAs($user); Is there a way to unauthenticate that $user within t

Make survey at laravel 5.4 and MySQL

I need to make a survey for my website. I have this: Route: Route::resource('survey','surveyController'); Controller: public function index() { $show=surve

There is no role named `admin`. laravel

i use this package : https://github.com/spatie/laravel-permission/tree/v2 code : $user=User::find(2); $user->assignRole('admin'); and when

Always have to clear cache in .env?

I am having a cache issue. I have a project and worked on local. Now whenever i upload to server and edit the .env and config/app.php file. It is not taking the

Log a user out of a website when they put their computer to sleep

This is a bizarre one. We have a Laravel website, and on said site we have a timer per user, where they get 15 minutes of being inactive before being booted. W

preventing abuse of API service usage

I am planning on using Laravel in my next web project, for the backend. Using the Laravel's built-in functionality I will build an API service. So my main conce

oauth-private.key does not exist or is not readable

So, I imported another project from Bitbucket and tried to launch it using php artisan serve, I always get this error: [LogicException]

Laravel: Create morphs() relationship nullable

I want to create a one-to-one polymorphic relation allow null relation. Example: Schema::create('ps_assistances', function (Blueprint $table) {

laravel using policy with many to many relationship pivot table

how do you set policy in many to many relationship since it is using pivot table ||laravel version 6|| Example:MainTable[company and user] PivotTable[company_u

Is it possible to use session from kernel console command in laravel?

I'm trying to fetch data from sessions when I run a command in my console, but session always returns an empty array! php artisan command:mycommand Below is

Laravel pass id to controller using AJAX

Route Route::post('approve', 'PostsController@approve'); javascript $(document).ready(function() { $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('

Parameter is not sent to Laravel route in Ajax

I'm working with Laravel 5.8 and I wanted to apply a discount code system for my site. So I tried sending data with Ajax like this: $.ajax({ type: 'POST',