I just created a new project of laravel version 5.5 with the laravel installer.And run the command “php artisan make:auth”.The views and controller are generated for the user authentication.And also run “php artisan migrate” to create tables needed in the database.When visiting the log…
Tag: laravel
is it possible to change the path to PHP that the Laravel task scheduler uses
I have a Laravel 5.4 app which is on shared hosting and the cron job isn’t working. I have set the command up in the kernel.php like so: And if I just run /usr/bin/php-5.6 artisan eoddsmaker:get_events from the command line it runs fine. When it gets called by the cron job though it doesn’t run. T…
How to count the rows by created date in Laravel query builder?
I am trying to count the rows by created_at like So I can show the client like in 2017-07-10, there are 8 people signed up. In 2017-08-13, there are 5 people signed up or something like that. Here is what I tried, but this is just showing only the number. Answer You could try something like this:
Laravel 5.4 get every day of the current week using Carbon
I’ve been using the syntax Carbon::now()->startOfWeek() and Carbon::now()->endOfWeek() for awhile now. It returns the first day of the week which is the date of Monday and the last day of the …
Laravel validate at least one item in a form array
I have a form with a series of numbers in an array: I would like to validate that there is at least one of those input fields that has a value. I tried the following in my OrderCreateRequest, yet the test is passing: Am I missing something? Answer I think you need a custom validation rule like the following b…
Create laravel blade horizontal table view from array
I have an Laravel DB::Query that give me result like this arrayResult = array(‘nip’ => ‘12345678’, ‘nama’ => ‘rachmat’, ‘month’ => ‘1’, ‘sum’ => 13′), array(‘nip’ => ‘…
Missing required parameters for [Route: ticket.edit] [URI: ticket_ads/edit/{ad}]
I am trying to edit a record in a table. I have created a route and the form, but I can’t get past this error. I have figured out the problem but I can’t find a fix. Am I correct in thinking that the edit.blade.php file needs the $ad->id passing? The $ad->id is an ID of a specific add in
Laravel 5.4 fopen(): Filename cannot be empty
I want to upload image in laravel 5.4 Here’s the code: in FilesystemAdapter.php (line 146) I checked the FileSystemAdapter.php and saw that the problem is in this line: When I var dump the $file variable it returns the correct info, but when I var_dump($file->getRealPath(); it says bool(false) and I …
Laravel 5.4 Combining two collections
So I Have two collections, sales and costs. Now I need them to combine into one collection for my foreach condition (I’m not sure if I can use two collections in one foreach) RAW Queries: Here’s my query for these two collections: Things I’ve tried testing: Converting the collections into ar…
Laravel : How to check dynamic url using Request::path()
I was trying to show a search box based on url means for specific route it will show the search box otherwise it won’t show. for that i used Request::path() . But the problem is for some route it doesn’t work. Suppose i have two routes, such as now if i used the following code: For the products ro…