Laravel 5.4 replace file if exist

I need to solve a small inconvenience that I am presenting with the update of an image when modifying the associated registry. When I modify the registry I want to replace the associated file that is in the directory. This is my table structure: S...
more »

2017-06-22 23:06 (1) Answers

How to use foreach inside array of foreach?

I am trying to insert data into database in json where multiple select has multiple option label and value. Simply I want to insert into database like this:- First select dropdown:- {"select":[{"placeholder":"test","options": [{"label":"option-...
more »

2017-06-22 11:06 (3) Answers

ManyToMany Laravel Relationship

I have my model products: class Product extends Model { protected $table = 'products'; protected $primaryKey = 'id_product'; protected $fillable = [ 'id_category', 'title', 'credit', 'created_at', 'updated_at', ]; public function ca...
more »

2017-06-21 20:06 (1) Answers

Laravel - Can't pass data through view

I try to send data from a controller to a view on Laravel 5.4. My controller "PagesController.php" : public function bird($id) { $infoBirdById = new InfoBird(); $birdById = $infoBirdById->getBirdById($id); $infoHealthById = new Inf...
more »

2017-06-21 17:06 (1) Answers

How to keep table values after searching?

I created a JavaScript filter to filter records from a product table, the filter is working normally, the problem is that when I clear the filter values, the table is returned in a different order. For example, my table is organized in Controller as...
more »

2017-06-21 15:06 (1) Answers

Laravel 5.4 - Undefined variable: markdown

I am trying to send a simple email with Laravel. I have no problem sending a normal HTML email but when I try to use the markdown feature I keep getting the error Undefined variable: markdown I am not using any instance of a model in my email righ...
more »

2017-06-21 14:06 (1) Answers

Php - Getting file size with an url

I am trying to get a file size of an image from a remote url, I am trying to this like so: $remoteUrl = $file->guid; //remote url example: http://myApp/wp-content/uploads/2017/05/Screen-Shot-2017-05-08-at-10.35.54.png $fileSize = filesize($rem...
more »

2017-06-21 13:06 (3) Answers

Laravel not storing phone number

Iam working on a school project, and i have a registration form. Iam working in laravel 5 and am using the auth package of laravel. I added my extra registration forms like this protected function validator(array $data) { return Validator::make(...
more »

2017-06-21 11:06 (1) Answers

TokenMismatch Error on Ajax Requests

I am getting TokenMismatch Error on Ajax Submit when I submit form it gives me error. Here I am using Laravel 5.2. Where I am passing X-CSRF-TOKEN on ajax call. Set Token on on meta on default.blade.php. I've tried all possible solutions from StackOv...
more »

2017-06-21 09:06 (6) Answers

I got Message for error_log file and

Tue Jun 20 13:17:41.195156 2017] [:error] [pid 14454] [client 203.131.216.144:60475] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/html/app/storage/logs/laravel.log" could not be o...
more »

2017-06-21 08:06 (1) Answers

Laravel inner join saying variable undefined

I am doing a search to filter through users that are displayed on my screen. The display of the users is working without the search. However when I type in the search a name, and go to display it, I get an undefined variable for search. $Search ...
more »

2017-06-21 04:06 (1) Answers

Break very long words with php mpdf

I have generated pdf file, everything works just fine, just one thing, if I write very long word for example: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq All document becomes small and unreadable, for some reason it tries to fit the word in 1 ...
more »

2017-06-20 19:06 (2) Answers

Spark: Assigning Roles to Invited Users

Using Laravel Spark, is there a way to -- either via UI or programmatically -- assign a team role to an invited user? That is, Laravel Spark doesn't allow admins to create users. Instead, a owner user invites them. This creates an entry in the inv...
more »

2017-06-20 19:06 (0) Answers

How to reuse a Dusk test browser instance?

My project on the Laravel 5.4 framework and I am using Dusk for browser tests. I have a page that has several sections I'd like to test independently, however I'm running into the problem where I have to start a new browser instance, login, and navig...
more »

2017-06-20 17:06 (0) Answers

Laravel route not defined error

I keep getting route not defined error and if I use url() I get server can not provide a secure connection error. I hope I can get some help. route Route::get('/show/{table_name}/{product_id}', 'PageCotroller@showdetails')->name('product-show');...
more »

2017-06-20 16:06 (2) Answers

Disconnect a specific user

I am currently using laravel 5.4, i get the list of online users, and i want from my admin-dashboard to make a specific user from my list to disconnect, is there a way to do so ? ...
more »

2017-06-20 16:06 (2) Answers

Laravel blade regex image and output it?

Hi I have twitter api working to output details on the page however, this field: {{ $item['text'] }} Gives me something like this: RT @JacksSmokehouse: Don't forget #HappyHour tomorrow until 6pm - #loveJacks @live_oldham #OldhamHour #YouDontKn...
more »

2017-06-20 15:06 (0) Answers

How can I get the required column from this table?

I'm putting together a simple report card system in Laravel just as a learning tool. At present I have a Pupil table, a Subject table, and a Pupil_Subject pivot table consisting of id, pupil_id, subject_id, and grade columns. I have the Pupil and Su...
more »

2017-06-20 14:06 (1) Answers