Category : laravel-5

Hard to describe this in the title so this image might clarify: I have a recursive view which outputs the above: @foreach($pages as $page) <option value="{{$page->id}}" @if($selected == $page->id) selected @endif >@for($i=0; $i<$levels; $i++)↪@endfor {{$page->title}} (#{{$page->id}}) </option> @if($page->children->count()) @include(‘cms::admin.partials.page-selector-option’, [‘pages’ => $page->children, ‘levels’ => $levels + 1]) @endif @endforeach Let’s say that a page has ..

Read more

I am using google drive as the photo storage of the application after uploading, but I have trouble trying to get the image path after uploading. How can I get the link? This is my code upload $name = $request->file(‘thumbnail’)->getClientOriginalName(); $image= $request->file(‘thumbnail’)->storeAs(‘/’, $name, ‘google’); If i use Storage::disk(‘google’)->allFiles() . I get the following array [ ..

Read more

This is my index page where I want to get name by ids. if there is single id in Staff_id coloum than it show but if their is multiple id than it only show first one @foreach($assignments as $assignment) <tr> <td> <form action="{{ route(‘assignments.complete’, $assignment->id) }}" method="post"> @csrf @if ($assignment->done_at == null or $assignment->done_at = ..

Read more

I’m upgrading Laravel from 5.2 to 5.3 I followed the steps mentioned here: https://laravel.com/docs/5.3/upgrade#upgrade-5.3.0 When I tried to to do composer update I kept getting: [2021-04-12 06:15:52] build.ERROR: exception ‘IlluminateContractsContainerBindingResolutionException’ with message ‘Target [IlluminateContractsAuthAccessGate] is not instantiable.’ in XXXXXXXXXXXX/admin/vendor/laravel/framework/src/Illuminate/Container/Container.php:763 #0 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Container/Container.php(644): IlluminateContainerContainer->build(‘IlluminateCont…’, Array) #1 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): IlluminateContainerContainer->make(‘IlluminateCont…’, Array) #2 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Container/Container.php(1203): IlluminateFoundationApplication->make(‘IlluminateCont…’) #3 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(175): IlluminateContainerContainer->offsetGet(‘IlluminateCont…’) #4 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(144): ..

Read more

I make task manager there is a form where to assign task I want to do that if user select multiple option then it is seperated by comma This is my form <form method="post" action="{{route(‘assignments.store’)}}"> @csrf <table> <tr> <td>Task Title : </td> <td> <select name="task_id" id="task_id"> @foreach ($tasks as $task) <option value="{{ $task->id }}">{{ $task->title ..

Read more

i tried to install brozat/laravel-FCM on laravel 8 i got this error on cmd: C:xampphtdocsnotifications>composer require brozot/laravel-fcm Using version ^1.3 for brozot/laravel-fcm ./composer.json has been updated Running composer update brozot/laravel-fcm Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 – brozot/laravel-fcm[1.3.0, …, ..

Read more

When I choosing multiple option in select box it make more than 1 id it store in different id I want to store all selected option in 1 id. This is my create form <form method="post" action="{{route(‘assignments.store’)}}"> @csrf <table> <tr> <td>Task Title : </td> <td> <select name="task_id" id="task_id"> @foreach ($tasks as $task) <option value="{{ $task->id ..

Read more

This is my AssignmentController Store function.(This is my AssignmentController Store function. ) This is my AssignmentController Store function.(This is my AssignmentController Store function. ) public function store(Request $request) { $request->validate(array( ‘staff’ => ‘array|required’, ‘staff_id’ => ‘required’, ‘staff.*.task_id’ => ‘required’, ‘done_at’ => ‘sometimes’, )); foreach($request->get(‘staff’) as $assignment) $assignment = Assignment::create(array( ‘staff_id’ => $request->array(‘staff_id’), ‘task_id’ => $assignment[‘task_id’], ..

Read more

This is my AssignmentController Store function. (This is my AssignmentController Store function.) This is my AssignmentController Store function. (This is my AssignmentController Store function.) public function store(Request $request) { $request->validate(array( ‘assignment’ => ‘array|required’, ‘assignment.*.staff_id’ => ‘required’, ‘assignment.*.task_id’ => ‘required’, ‘done_at’ => ‘sometimes’, )); foreach($request->get(‘assignment’) as $assignment) $assignment = Assignment::create(array( ‘staff_id’ => $assignment[‘staff_id’], ‘task_id’ => $assignment[‘task_id’], ..

Read more

I make task management system and i don’t know well how to assign task to multiple users at same time? This is my AssignmentController Store function. public function store(Request $request) { $request->validate(array( ‘assignment’ => ‘array|required’, ‘assignment.*.assigned_to’ => ‘required’, ‘task_title’ => ‘required’, ‘task_description’ => ‘required’, ‘done_at’ => ‘sometimes’, )); foreach($request->get(‘assignment’) as $assignment) $assignment = Assignment::create(array( ‘task_title’ ..

Read more

I am using laravel queue to get laters record of users If two users use the same functaion at same time , the values get replicated this is my code on controller ……. SendInvitation::dispatch($email,$name,$nhs_number,$appInfo,$userInfo)->onQueue(‘high’); …….. SendInvitation on quaue code public function handle() { try { $user = User::orderBy(‘created_at’,’DESC’)->first(); if($user != null){ $enu_id = $user->invitation_id; }else{ ..

Read more

i make a task manager for practice. I have 1 query that how can i assign task to multiple users by filling 1 form This is my TaskController public function store(Request $request) { $request->validate([ ‘staff_id’ => ‘required’, ‘task’ => ‘required’, ‘done_at’ => ‘sometimes’, ]); $task = Task::create([ ‘staff_id’ => $request->input(‘staff_id’), ‘task’ => $request->input(‘task’), ‘done_at’ => ..

Read more

I have this code can anyone tell what i am doing wrong $this->form[] = [‘label’=>’Brand’,’name’=>’id_brand’,’type’=>’select2′,’validation’=>’required|integer|min:0′,’width’=>’col-sm-10′,’datatable’=>’fms_brands,brand’]; $this->form[] = [‘label’=>’Brand Model’,’name’=>’id_brandmodel’,’type’=>’select2′,’validation’=>’required’,’width’=>’col-sm-10′,’parent_select’=>’id_brand’,’datatable’=>’fms_brandmodel,id,id_brand’,’datatable_format’=>"model,’ – ‘,year"]; and I would prefer to have id from fms_brandmodel in the value not the text from datatable_format and how can I make them multi select Sourc..

Read more

In the below I want to access the route get product only if the user role is admin. How can I do that? User Model in database public function up() { Schema::create(‘users’, function (Blueprint $table) { $table->id(); $table->string(‘name’); $table->string(‘role’); $table->string(’email’)->unique(); $table->timestamp(’email_verified_at’)->nullable(); $table->string(‘password’); $table->rememberToken(); $table->timestamps(); }); } Product Model public function up() { Schema::create(‘products’, function (Blueprint ..

Read more

I have created a subscription for any of product using laravel cashier and the subscription is for one month then in id of subscription user wants to sowngrade or upgrade his subscription then how can we calculate unused time on cost on existing subscription in laravel cashier. I am not using stripe/stripe-php i am using ..

Read more

I need to upgrade a laravel project from 5.2 to 5.8. as per the upgrade document, I try upgrading a project from laravel 5.2 to laravel 5.3. i change my composer.json, and when I remove the argument from the boot method from EventServiceProvider, RouteServiceProvider, and AuthServiceProvider my code editor show error, and if i tolerate ..

Read more