Category : laravel

I have some routes use with middleware here is one example Route::get(‘/TobeSubmit’, ‘[email protected]’)->name(‘TobeSubmit’); when I use this route outside of middleware its working. here is that middleware Route::group([‘middleware’ => [‘auth’,’Admin’]],function (){ }); when I use that route inside middleware Route::group([‘middleware’ => [‘auth’,’superuser’]],function (){ Route::get(‘/TobeSubmit’, ‘[email protected]’)->name(‘TobeSubmit’);}); like this, its not working, that route use for data ..

Read more

How I can associate business with employees and owner (User table but using roles like Admin/Owner/Manager/Employee) and branches? public function getIsAdminAttribute() { return $this->hasRole(‘administrator’); } public function getIsOwnerAttribute() { return $this->hasRole(‘owner’); } public function getIsManagerAttribute() { return $this->hasRole(‘manager’); } public function getIsEmployeeAttribute() { return $this->hasRole(’employee’); } So I can know who is owner of business ..

Read more

I was reading Laravel Cache Documentation, and it said that a lock could be migrated to a job and then released after restoring the instance via the owner, like Cache::restoreLock(‘processing’, $this->owner)->release(); or doesn’t respect to the current owner, like Cache::lock(‘processing’)->forceRelease(); Which leads me to a question, what’s the difference between them?, or maybe what are ..

Read more

In first Image You can see how i am sending json object as form data in order_details parameter. In second Image i am getting response while decoding it in Laravel 7. public function makeOrder(Request $request) { $validator = Validator::make($request->all(), [ ‘table_id’ => ‘required’, ‘date’ => ‘required’, ‘time_slot’ => ‘required|string’, ‘product_ids’ => ‘required|array’, ‘total_bill’ => ‘required’ ..

Read more

i am trying to get permission all id which is checked by user but unfortunately i am not getting permission ids in proper array format please help me how can i do that ? please my format below thanks. I want to get permissions ids like this. { "_token": "Eo1ByYyiFyrzvTXqqlUUAszTk8AMa8CjC9xpRa0l", "name": "dfsdfsdf", "permission": { 1,2,3,4,5,6,7, ..

Read more

I have table <thead> initialized in in blade and foreach loop for <tbody> in controller so this is how it looks in controller: foreach($data as $row) { $output .= ‘ <tr> <td>’.$row->year.'</td> <td> <a href={{url(/edit/’.$row->id.’)}} class="…">Edit</a> <a href="#" class="…">Delete</a> </td> </tr> ‘; } and in the blade, initialized like this: <table> <thead> <tr> <th>Year</th> <th> ..

Read more

i am using Laravel 8 and I am using built in Auth module. I am login with mobile using ajax request. When user login and page redirct i get error /undefined route. I attach screen shoot of error. My ajax code is, $.ajax({ type: "POST", url: "/login", headers: { ‘X-CSRF-TOKEN’: $(‘meta[name="csrf-token"]’).attr(‘content’) }, data: { ‘mobile’ ..

Read more

i wanted to upload image using vue template in laravel i just create a simple code but i got this problem.. check my code below <template> <dir class="composer"> <input type="file" @change="sendFiles"> <textarea v-model="message" @keydown.enter="send" placeholder="Message…"></textarea> </dir> </template> <script> export default { data() { return { message: ”, files: [] }; }, methods: { sendFiles(event) { ..

Read more

I have laravel 6.2 version which is running perfectly on my windows system. But, when i have put my project folder on to ubuntu pc it is giving me the error. SymfonyComponentDebugExceptionFatalThrowableError : Class ‘pathtoclass’ not found Path to class starts from ‘AppHttpControllersFolderClassFile’. `use AppHttpControllersFolderFolderclassFile as File;` ‘class ExampleController extends Command { public $new_file; public ..

Read more

After reinstall vagrant(2.2.14), virtualbox(6.1.16) and installing tue box with the command found on the laravel website (ok for bash init.sh and the ssh-keygen), i have this : $ vagrant box list laravel/homestead (virtualbox, 10.1.1) When i try to launch this VM ("vagrant up" in the "~/Homestead" directory) i’ve got: Bringing machine ‘homestead’ up with ‘virtualbox’ ..

Read more