What is the best practice to handle multi auth in Laravel 5 and up

Following are the two different techniques which I have been using to handle multi auth in Laravel 5 and above apps. Suppose I got 4 types of users. Seller Merchant Admin Affiliate And the URLs look like this: https://example.com/seller/dashboard https://example.com/merchant/dashboard https://example.com/admin/dashboard https://example.com/affiliate/dashboard Note: The user role name should stay in all the URLs which you…

Laravel 5.8 request data is empty

router.php Route::get(‘/p00001/edit/{center}/{id}’, ‘Dashboard\Programs\P00001Controller@edit’); Route::put(‘/p00001/update/{center}/{id}’, ‘Dashboard\Programs\P00001Controller@update’); form.blade.php <!DOCTYPE html> <html dir=”ltr” lang=”zh-TW”> <body> <form id=”mainform” action=”/dashboard/programs/p00001/update/JPN/3121-111907230007″ method=”post” class=”form-horizontal”> <input type=”text” value=’1234′ id=”inpTest” name=”inpTest”> <input type=”submit” name=”inpSubmit”> </form> </body> </html> P00001Controller.php public function __construct(Request $request, P00001Service $P00001Service ) { $this->request = $request; } public function update($center, $id) { $data = $this->request->all(); echo “<pre>”, print_r($_POST, 1), “</pre>”; echo…

Laravel eloquent with() returns null

namespace App; use App\Model\Service\Area; use App\Model\Bid\Service; use Illuminate\Database\Eloquent\Model; class Bid extends Model { protected $table = “bid”; protected $primaryKey = ‘bid_id’; protected $guarded = []; protected $with = [‘services’]; public function services() { return $this->hasMany(Service::class, ‘bid_id’); } public function area() { return $this->belongsTo(Area::class, ‘area_id’, ‘area_id’); } } namespace App\Model\Service; use Illuminate\Database\Eloquent\Model; class Area extends Model…

why cannot i push my laravel project to github

i have made discussion forum but i cannot push my project to github i have tried all method but it is still not working i have set ssh key in github. root@miky-Lenovo-ideapad:/opt/lampp/htdocs/discussionforum# git remote add origin git@github.com:milan2056/discussionforum.git root@miky-Lenovo-ideapad:/opt/lampp/htdocs/discussionforum# git push -u origin master git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please…

I can’t store uploaded images in public laravel

I want to upload some pictures and store them in public/ but it store in storage/app/public i used php artisan link:storage before And this is the code: public function store(Request $request) { $new_file_data=[ ‘small_explain’=>$request->input(‘small_explain’), ‘title’=>$request->input(‘title’), ‘paragraph_one’=>$request->input(‘paragraph_one’), ‘paragraph_two’=>$request->input(‘paragraph_two’), ‘paragraph_list’=>$request->input(‘paragraph_list’), ‘paragraph_three’=>$request->input(‘paragraph_three’), ‘important_body’=>$request->input(‘important_body’), ‘quote’=>$request->input(‘quote’), ‘author_quote’=>$request->input(‘author_quote’), //image storage ‘index_image’ => $request->file(‘index_image’)->store(‘/public/Images’), ‘header_image’ => $request->file(‘header_image’)->store(‘/public/Images’ ), ‘text_image’ =>$request->file(‘text_image’)->store(‘/public/Images’), ]; Article::create($new_file_data);…