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

public function matchOrNot() { $belediyeprofils = DB::table(‘belediye_profil’)->join(‘envanter_genel’, ‘envanter_genel.belediye_id’, ‘=’, ‘belediye_profil.id’)->where(‘envanter_genel.status’, 8)->get(); // $envantergenels = DB::table(‘envanter_genel’)->join(‘belediye_profil’, ‘envanter_genel.belediye_id’, ‘=’, ‘belediye_profil.id’)->get(); $i=0; foreach ($belediyeprofils as $belediyeprofil) if($i<100) { { $q = $belediyeprofil->name; $w = $belediyeprofil->ilce; $s = $belediyeprofil->id; } if(strpos($q, $w)!== false) { return $s ; //Matched } else { $returnData = //notMatched [ ‘Sayaç’ => $i, ‘Id’ ..

Read more

If I run the installation command, at the end of the process it throws the following error [ComposerRepositoryInvalidRepositoryException] Invalid repository data in C:Usersفونكس تكنولوجيDocumentsgs-design-web/vendor/composer/installed.json, packages could not be loaded: [ SeldJsonLintParsingException] "C:Usersفونكس تكنولوجيDocumentsgs-design-web/vendor/comp oser/installed.json" does not contain valid JSON Parse error on line 4813: ———————^ Expected: ‘STRING’ It appears you have an extra trailing comma ..

Read more

I’m trying to work with foreign keys on Laravel. It’s quite simple how to add foreign key on table. But if table can contain more than one foreign key, for example: Table posts: id, post_title post_content post_category (can be more than one) Table category id, category_title, — I want to get posts list with each ..

Read more

How to restrict the direct access to files in Laravel (http://localhost/laravel-blog/public/uploads/sample.jpg) The problem is: If it shows the folder it will try to access other files, directly opening the document path. If I put in URL uploads then it will return nothing, but If I put full URL with the path then it is accessible. ..

Read more

i’m using laravel form request validation to validate a request from view to controller. i’m using php artisan make:request SpecializedRequest. but when the validation fail it doesn’t return back and it gave error 422. i’ve looked up at laravel documentation and i don’t really understand it. How do i make sure if the validation fail ..

Read more

I have the following code below in which at the end of code i want it to redirect it to another. So, how could i achieve that. public function edit($id) { $data[‘menu’] = ‘request_payments’; $data[‘request_payments’] = $request_payments = RequestPayment::find($id); ////// some code here return view(‘admin.RequestPayment.edit’, $data); // at that point i want it to redirect ..

Read more

so I have this store function at my Controller public function store(Request $request) { Penghuni::create([ ‘nama_penghuni’ => $request->nama_penghuni, ’email’ => $request->email, ‘phone’ => $request->phone, ‘tower’ => $request->tower, ‘no_unit’ => $request->no_unit ]); User::create([ ‘name’ => $request->nama_penghuni, ’email’ => $request->email, ‘password’ => Hash::make($request[‘password’]), ‘role’ => ‘penghuni’, ]); return redirect(route(‘penghuni.index’)); } what I want is make sure both ..

Read more

I have three table A,B,C And Structure Is Shown Below Table A ———————- |id | text_message | ———————- |1 | first Message | ———————- |2 | second Message | ———————- Table B ———————————– |id | request_id | approved_status| ———————————— |101 | 1 | 2 | ———————————— |102 | 1 | 1 | ———————————— |103 | ..

Read more

I have three table A , B and C and it structure is shown below Table A —————————- | id | Text_message_to_show| —————————- | 1 | first demo message | —————————- | 2 | second demo message | —————————- Table B ———————————— | id | request_id | approved_status | ———————————— | 101 | 1 | ..

Read more

I use a javascript code to upload multiple files to the server. the problem is that when I upload multiple files with 10 MByte size for example and the server storage only has space for 5 Mbyte then some of the files will upload and some not. I want to send the response name of ..

Read more

I have an existing application developed using laravel and wanted to update it from laravel 5.4 to laravel 7 or 8 , How can I do that ? Is it the only way to do it step by step 5.4 to 5.5, 5.5 to 5.6, 5.6 to 5.7 and so on Or is there any ..

Read more