laravel

Laravel: Is it possible to log stack trace when exception caught, and continue the execution?

ぃ、小莉子 提交于 2021-02-18 22:42:34
问题 Laravel has readable log and stacktrace when exception caught, for example: production.ERROR: Command "test" is not defined. Did you mean this? make:test {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"test\" is not defined. Did you mean this? make:test at {root}/vendor/symfony/console/Application.php:618) [stacktrace] #0 {root}/vendor/symfony/console/Application.php(229): Symfony\\Component\\Console\\Application->find('test') #1

Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) Laravel

寵の児 提交于 2021-02-18 22:12:45
问题 I have a problem with Laravel . after restart my system, My project will not run !!! I run with php artisan serv , but I have below messages in console : [Tue Jul 3 14:31:35 2018] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /laravel-projects/blog/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 122 [Tue Jul 3 14:31:35 2018] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried

Very slow laravel homestead/vagrant/virtualbox on Mac OSX

跟風遠走 提交于 2021-02-18 21:12:23
问题 I am using Homestead + Vagrant + Virtualbox on a Mac . Problem While I found lots of threads/answers how to fix slow response times (e.g. TTFB) none of them worked. My response times vary between 25 - 32 seconds, which of obviously is not acceptable for local development. Suggested Solutions I have tried a lot of suggested solutions from here: https://github.com/laravel/homestead/issues/901 And have also read and tried many suggestions from these threads: Very Slow Responses On Homestead

Very slow laravel homestead/vagrant/virtualbox on Mac OSX

走远了吗. 提交于 2021-02-18 21:12:20
问题 I am using Homestead + Vagrant + Virtualbox on a Mac . Problem While I found lots of threads/answers how to fix slow response times (e.g. TTFB) none of them worked. My response times vary between 25 - 32 seconds, which of obviously is not acceptable for local development. Suggested Solutions I have tried a lot of suggested solutions from here: https://github.com/laravel/homestead/issues/901 And have also read and tried many suggestions from these threads: Very Slow Responses On Homestead

Laravel “undefined method Illuminate\Database\Query\Builder::attach()”

筅森魡賤 提交于 2021-02-18 20:50:46
问题 I'm trying to associate related models during database seeding in Laravel 4. According to the documentation here, I can do it like this: $user->roles()->attach(1); So, in my database seed I'm running: $package = Package::create([ 'name' => $faker->word, 'summary' => $faker->sentence, 'base_price' => $faker->randomFloat(2, 200, 10000) ]); // Attach 1-5 randomly selected items to this package foreach(range(1, 5) as $index) { $randomItem = Item::orderBy(DB::raw('RAND()'))->first(); $package-

Laravel Vue Non SPA - How to split the files for every page for its vue js components?

帅比萌擦擦* 提交于 2021-02-18 13:00:10
问题 My application is using laravel vue but not SPA,.. so im still using laravel blades to separate the pages. Every page are importing app.js. My App.js is compiled by webpack and all my vue components are compiled on that file. so the problem is the app.js getting MB size and the every page will slow to load that file. Is their way to split the code of vuejs or separate the file for every pages using webpack? this is my webpack.js in my web application. const mix = require('laravel-mix'); /* |-

Laravel Vue Non SPA - How to split the files for every page for its vue js components?

不问归期 提交于 2021-02-18 13:00:10
问题 My application is using laravel vue but not SPA,.. so im still using laravel blades to separate the pages. Every page are importing app.js. My App.js is compiled by webpack and all my vue components are compiled on that file. so the problem is the app.js getting MB size and the every page will slow to load that file. Is their way to split the code of vuejs or separate the file for every pages using webpack? this is my webpack.js in my web application. const mix = require('laravel-mix'); /* |-

Laravel 4 Eloquent returns wrong ID

有些话、适合烂在心里 提交于 2021-02-18 12:04:27
问题 I have 3 tables in my database: Campaigns Users Companies One company may have some users. One user may have some campaigns. A user (with admin rights) can do some actions with any campaign that belongs to his company. So, I want to check whether he's doing these actions with his campaign or not (in the last case I return something like "access denied"). My condition Campaign::join('users', 'users.id', '=', 'campaigns.user_id') ->where('users.company_id', '=', Auth::user()->company->id) -

Laravel 4 Eloquent returns wrong ID

为君一笑 提交于 2021-02-18 12:03:45
问题 I have 3 tables in my database: Campaigns Users Companies One company may have some users. One user may have some campaigns. A user (with admin rights) can do some actions with any campaign that belongs to his company. So, I want to check whether he's doing these actions with his campaign or not (in the last case I return something like "access denied"). My condition Campaign::join('users', 'users.id', '=', 'campaigns.user_id') ->where('users.company_id', '=', Auth::user()->company->id) -

Laravel - Include assets on Middleware Auth

会有一股神秘感。 提交于 2021-02-18 11:47:46
问题 Inside my app, exist a route group called admin , any route inside this group call two resources: public/css/admin.css and public/js/admin.js , but any unauthenticated user has access to these files. How can I include these files inside the Auth Middleware? My admin routes: Route::group(['prefix' => 'admin', 'middleware' => ['auth']], function () { Route::get('/', 'Admin\IndexController@index')->name('panel'); Route::group(['prefix' => 'users'], function() {}); Route::group(['prefix' =>