#### Category : laravel-5

There i Have a warning In Laravel 5.5 in This Code: Route::prefix(‘dashboard’)->group(function () { Route::get(‘/’, function () { return ‘index’; }); Route::get(‘/menu’, function () { return ‘menu’; }); }); i have this warning: Required parameter ‘$routes’ missing Sourc.. Read more i have collection IlluminateSupportCollection {#1453 #items: array:4 [ 0 => "three" 1 => "nine" 2 => "one" 3 => "two" ] } and this string ‘one’, ‘two’, ‘three’ i am trying to validate if these all strings available in array$array->contains(‘one’, ‘two’, ‘three’) it should return true but everytime i am getting false what i ..

I’m trying to make a custom forgot password but when I’m trying to send the email it gives this error Argument 1 passed to AppHttpControllersAuthPasswordController::AppHttpControllersAuth{closure}() must be an instance of IlluminateMailMessage, instance of AppModelsUser given, called in D:laragonwwwlaravel8vendorlaravelframeworksrcIlluminateAuthPasswordsPasswordBroker.php I’ve tried with these two methods $response = Password::sendResetLink($request->only(’email’), function (Message $message) {$message->from(‘[email protected]’, Config::get(‘APP_NAME’)); $message->subject($this->getEmailSubject()); }); ..

i´m traying to do query into my repository to get galleries that to have a restaurant and i need seach for id. One restaurant´s gallery only can to have 10 images, but we can to have more than one restaurant. I need that when one restaurant will have a 10 images, it can´t upload any ..

I am using maatwebsite to export the records to CSV file. Using php laravel for backend. Here is my following code: Controller code: public static function exportCsvReport($params){ header(‘Content-Encoding: UTF-8’); header(‘Content-type: text/csv; charset=UTF-8’); return Excel::download(new UsersExport, ‘invoices.xlsx’); } UserExport model: <?php namespace AppExports; use AppModelsApiv1Tbcall; use MaatwebsiteExcelConcernsFromCollection; class UsersExport implements FromCollection { public function collection() { .. Read more I am using Laravel 8 as a framework and my Image Upload page keeps me redirect back to the same page with status code 302 Found. I have cross-checked all the routes and code for any possible error but failed to find the problem. I have also tried solutions of SO and Goole but unable .. Read more I’m a beginner in laravel and I’ve been trying to create a simple ecommerce web but i got stuck in this logic error for days. I’ve been following in a youtube tutorial about creating shopping cart but the item quantity won’t increment if i add the same item in the cart. The totalPrice and totalQty .. Read more in laravel routing we can pass a closure and it returns the result. so my question is why it cannot echo or print the result than returning it?. is it the closurity property of php or laraveles routing rule. Route::get(‘/’,function(){ return ‘hello world’; }); Sourc.. Read more I am trying to integrate Twilio in my Laravel application so far I was doing great generated the access token, created the device but when I run device.connect(param) it give me this error in the console. twilio.min.js:99 Received an error from MediaStream: Error code: 31000 I have searched the twilio documentation for this error but .. Read more I am getting error Call to undefined method AppHttpControllersProfilesController::authorize() in Laravel 5.8xx but I think I am doing everything right. Controller: public function edit(User$user) { $this->authorize(‘update’,$user->profile); return view(‘profiles.edit’, compact(‘user’)); } Profile Policy public function update(User $user, Profile$profile) { return $user->id ==$profile->user_id; } Sourc..

I wanted to apply some condition in foodOrders. Is it possible to apply condition inside map function that acts as where $foodOrder->foodOrders->where(‘invoice_id’,null)->get(); public function getTableList(Request$request){ $skip =$request->skip; $limit=$request->limit; $totaltable = Table::get()->count();$table = Table::skip($skip)->take($limit)->orderBy(‘id’, ‘DESC’)->get(); $table->map(function($foodOrder){ $foodOrder->foodOrders; }); } Below is the output that this query returns. But I only want the data with .. Read more For now i need to declare in laravel model like that protected$fillable = [ ‘object_name’,’attributes’,’item’,’cost’,’status’,’category’,’object_id’,’status’,’customer_id’,’provider_id’ ]; after that, I can insert value in the database. Is there any way that can make all columns of every newly created table fillable so I will need to change it every time. Sourc..

@foreach($data as$var) <tr> <td style="text-align:center;"> <input type="checkbox" id="select" class="sub_chk" data-id="{{$var->id}}" value="{{$var->id}}" name="selected_values[]"/> </td> <td>{{$var->id }}</td> <td>{{$var->name}}</td> <td>{{$var->email}}</td> <td> <?php$elements = array(); ?> @foreach($var->student_registrars as$category) <?php $elements[] = ‘<a href=" ‘.route(‘student-registrars.show’,$category->id).’ "> ‘.$category->name.’ </a>’; ?> @endforeach <?php echo implode(‘,<br>’,$elements); ?> </td> <td> // Second foreach should be here </td> <td> <a ..

@foreach($data as$var) <tr> <td style="text-align:center;"> <input type="checkbox" id="select" class="sub_chk" data-id="{{$var->id}}" value="{{$var->id}}" name="selected_values[]"/> </td> <td>{{$var->id }}</td> <td>{{$var->name}}</td> <td>{{$var->email}}</td> <td> <?php$elements = array(); ?> @foreach($var->student_registrars as$category) <?php $elements[] = ‘<a href=" ‘.route(‘student-registrars.show’,$category->id).’ "> ‘.$category->name.’ </a>’; ?> @endforeach <?php echo implode(‘,<br>’,$elements); ?> </td> <td> // Second foreach should be here </td> <td> <a ..

I have installed laravel recently via composer but in browser it shows these errors Warning: require(D:xampphtdocslaravel-8.xvendorcomposer/../symfony/deprecation-contracts/function.php): failed to open stream: No such file or directory in D:xampphtdocslaravel-8.xvendorcomposerautoload_real.php on line 69 Fatal error: require(): Failed opening required ‘D:xampphtdocslaravel-8.xvendorcomposer/../symfony/deprecation-contracts/function.php’ (include_path=’D:xamppphpPEAR’) in D:xampphtdocslaravel-8.xvendorcomposerautoload_real.php on line 69 Sourc..

I want laravel app stop working after a specific date. Will you please tell me what code is to be inserted and where to be inserted? I am new to laravel. Sourc..

First time working on pipelines and CI in general so I may stuff that are wrong. I was trying to build a pipeline to automate deployment for our project on CPanel (Don’t ask me, client already had that setup when I joined). Here’s what our bitbucket-pipelines.yml file looks like atm: image: php:7.3-fpm pipelines: branches: staging: ..

I have a Laravel application in which I need to display all time slots between 9AM to 3AM on the basis of 15 minutes interval. the time slots does not contain no date, only times format like (AM and PM) Sourc..

My Laravel app is really very slow, it takes more than 3 seconds to get a response, sometimes less. even if I tried to call a route with an empty controller the time to get the response is 3 seconds. My controller: function index(Request $request){ echo "hi"; exit; } response time Sourc.. Read more i want to echo ouptut from controller When i dump this object i get all data like i want, but how to echo that I want to display this data like this Here is my controller `$pkm = DB::table(‘magacin_pkms’)->select( ‘magacin_pkms.status’, ‘magacin_pkms.izdao_to’, ‘users.name as izdaoFirstName’, ‘users.lastname as izdaoLastName’, ‘magacin_pkms.vrednost’, ‘magacin_pkms.izdao_by’, ‘magacin_pkms.izdao_at’ ) ->join(‘users’, ‘id_user’, ‘izdao_to’) ..

I’m trying to validate date time through Laravel Validation like this: $this->validate($request,[ ‘DateTime’=> ‘required|after_or_equal:’ . date(‘Y-m-d H:i:s’), ]); I want to restrict the user if they enter date time greater than current date time but in my case date is being validated but i have to validate time also. Format of date time is 2020-12-23 ..