laravel-5.3

How to decrypt cookie?

泄露秘密 提交于 2019-12-03 08:16:22
I've just caught a crash reported on sentry, I am trying to debug and see the root cause for the problem. Luckily, in the cookies panel, I can see the laravel_session value that was used while crash happened. The question, is, how can decrypt the cookie? You can decrypt the cookie with the following code: $cookie = 'eyJpdiI6ImFUQ0FvMWFSVlNvTmhlQjdLWGw1Z1E9PSIsInZhbHVlIjoicFh6Q09iTDl0K0huWU1Nc1NYVmxSY2hPRGU5Vk85dDJyYUpRbUVjRWg5R0JxYkVobkF3YkZVcVQrakFFUmxaVnZrTjFST3F3RTZ4akpDZEpvUFJiQXc9PSIsIm1hYyI6IjlhYmJhMTY3MWMxYWI3YjJmNmFjMmNkZWE0MWZmMmVhNTNiMjI5ZWY3NzUwNzQ0ZjAzMGQ1ZGU0YzVhNjJmZGYifQ==';

Disable error reporting entirely in Laravel production?

核能气质少年 提交于 2019-12-03 06:47:45
I would like to disable error reporting entirely on production, because we have some very old code we still need to fix but for now does work (yes I don't like it either). We cannot fix everything in a few days, so we need to just supress the warnings and exceptions like we always did. The real problem is that it already throws an exception on a simple lazy bug like (because var is not defined) if(!$var) { // do whatever } tried APP_DEBUG=false APP_LOG_LEVEL=emergency display_errors(false); set_error_handler(null); set_exception_handler(null); But it still shows an ErrorException Undefined

What happened to Laravel's redirectTo() method?

烈酒焚心 提交于 2019-12-03 05:30:29
We can override this property to redirect users after login in LoginController: protected $redirectTo = '/home'; And here is the statement from documentation: If the redirect path needs custom generation logic you may define a redirectTo method instead of a redirectTo property: protected function redirectTo() { // } But it always redirects to '/home'; whatever the condition is. protected function redirectTo() { if (Auth::user()->role==0) { return '/volunteer'; } else { return '/donor'; } } If a method exists it'll use it, otherwise the property will be used. But it looks like property is being

Uninstall Laravel Valet

穿精又带淫゛_ 提交于 2019-12-03 05:06:54
问题 I installed Valet for the first time and I had some problems listed below: It throws an error saying: Unable to determine linked PHP. Even though I have PHP 7.1 installed by php-osx.liip.ch so it just goes ahead and installs PHP 7.0 with homebrew anyway! In the non-laravel projects my localhost does not work and it responds: ERR_EMPTY_RESPONSE and then Valet itself does not work either! I'm getting an error on Valet domains with message: This site can’t be reached laravel_from_scratch.dev’s

Laravel 5.3 db:seed command simply doesn't work

余生长醉 提交于 2019-12-03 04:55:42
I do everything by-the-book: Installed fresh Laravel 5.3.9 app (all my non-fresh apps produce the same error) run php artisan make:auth create migrations for a new table `php artisan make:migration create_quotations_table --create=quotations Schema::create('quotations', function (Blueprint $table) { $table->increments('id'); $table->string('text'); // my problem persists even with the below two columns commented out $table->integer('creator_id')->unsigned()->index('creator_id'); $table->integer('updater_id')->unsigned()->index('updater_id'); $table->softDeletes(); $table->timestamps(); });

Laravel 5.3 Notification Vs Mailable

陌路散爱 提交于 2019-12-03 04:29:04
I am a little confused about whether to use Laravel's Notification or Mailable class. From what I understand, Mailables are used to send only emails whereas Notifications can be used to send emails and sms. In my application, I dont have plans to send sms notifications for now, so I am confused if I should just use the Mailable class in this case. My questions are: If I am only going to be sending emails notifications, is it better for me to use Mailables instead of Notifications? If each emails have different html layout, then would Mailable be the better option? Even if all emails are

What is the best practice for adding constants in laravel? (Long List)

谁都会走 提交于 2019-12-03 04:11:59
问题 I am rather new to laravel. I have a basic question, What is the best way to add constants in laravel. I know the .env method that we use to add the constants. Also I have made one constants file to use them for my project. For example: define('OPTION_ATTACHMENT', 13); define('OPTION_EMAIL', 14); define('OPTION_MONETERY', 15); define('OPTION_RATINGS', 16); define('OPTION_TEXTAREA', 17); And so on. It can reach upto 100 or more records. So What should be the best approach to write the

Vuejs js for multiple pages, not for a single page application

♀尐吖头ヾ 提交于 2019-12-03 03:25:43
问题 I need to build an application using laravel 5.3 and vuejs 2, because I need to use two-way binding rather than use jquery. I need to set up the views with blade templates. Then, I need to use vuejs in each page as mentioned below. resources/asserts/js/components/List.vue <script> const panel = new Vue({ el: '#list-panel', name: 'list', data: { message: 'Test message' }, methods: { setMessage: function(){ this.message = 'New message'; } } }) </script> resources/asserts/views/post/index.blade

Laravel Passport Password Grant - Client authentication failed

徘徊边缘 提交于 2019-12-03 01:22:24
After hearing a lot about laravel passport, i thought of implementing it into my new project where my requirement is to create an API that'll be used in a mobile app. So my mobile app is a client , which will further have its users. I followed the steps mentioned by Taylor and also read about it here . In a nutshell I followed these steps: Installed laravel/passport . Created a website user. Generated passport keys php artisan passport:install Generated client_id and client_secret using php artisan passport:client Added redirection and callback routes in web.php Authorized the user and got the

I want to get user id in laravel 5.3 controller with Auth::user()->id but it creates error their

吃可爱长大的小学妹 提交于 2019-12-02 23:17:37
问题 I have created a points table and there users points will be debited credited. the structure is like following. id userid p_add p_less description created_at updated_at 1 9 3000 0 purchased -time- -time- 2 9 0 300 expend -time- -time- and I am using following controller code. public function account_page(){ $points = Points::select(DB::raw("sum(p_add)-sum(p_less) as Total"))->where('user_id', 9)->first(); return view('mop.account-page', array('points'=>$points)); } so in view page named as