laravel-5.3

Auth guard driver [api] is not defined?

两盒软妹~` 提交于 2021-02-09 11:06:15
问题 I use this library jwt-auth-guard in Laravel 5.3. When I try open page I get error: InvalidArgumentException in AuthManager.php line 99: Auth guard driver [api] is not defined. How can I fix it? I made everything that was need 回答1: I'm not sure, please check you guard driver setup into config/auth.php first. You can cross check this from GIT repo. Let me know if any concern from above. 回答2: If you are using tymondesigns/jwt-auth package first check that you are downloading the latest version

Method orWhere does not exist. Laravel 5.3

Deadly 提交于 2021-02-08 13:16:17
问题 BadMethodCallException in Macroable.php line 74: Method orWhere does not exist. $category = $categories->where('Node_ID', (explode('.', $cat{$title_id})[0])) ->orWhere('Node_Path', $cat->{$category_name}) ->first(); If I try without "orWhere" works, if I use it, throws an Error. Someone knows where is the mistake? 回答1: You are trying to use orWhere on collections, thats why its showing you the error. You should use this on model like this (taking Category as a Model): $category = Category:

Edit db record with modal window

。_饼干妹妹 提交于 2021-02-08 07:58:53
问题 I'm trying to edit some database record based on an ID that I'm saving into a button value. @foreach ($employment as $empl) <button data-toggle="modal" data-target="#edit-empl" href="#edit-empl" class="btn btn-default editbtn-modal" value="{{ $empl->id }}" type="button" name="editbtn">Edit</button> <h3 class="profile-subtitle">{{ $empl->company }}</h3> <p class="profile-text subtitle-desc">{{ $empl->parseDate($empl->from) }} - {{ $empl->parseDate($empl->to) }}</p> @endforeach As you can see

How to change the user model in laravel to use other table for authentication than users?

女生的网名这么多〃 提交于 2021-02-07 10:13:12
问题 How can i change the default user model to use other database table instead of users table in laravel 5.3, is adding protected $table = 'my_table_name'; will do everything or do i have to change the providers and all. I dont wish to use multiple authentication like admin, customers etc i just want one authentication model but not with the table "users". I am preparing an application which has multiple type of users like admin, astrologers and users. all of them have different attributes so i

How to change the user model in laravel to use other table for authentication than users?

谁说我不能喝 提交于 2021-02-07 10:12:49
问题 How can i change the default user model to use other database table instead of users table in laravel 5.3, is adding protected $table = 'my_table_name'; will do everything or do i have to change the providers and all. I dont wish to use multiple authentication like admin, customers etc i just want one authentication model but not with the table "users". I am preparing an application which has multiple type of users like admin, astrologers and users. all of them have different attributes so i

How to change the user model in laravel to use other table for authentication than users?

我们两清 提交于 2021-02-07 10:12:12
问题 How can i change the default user model to use other database table instead of users table in laravel 5.3, is adding protected $table = 'my_table_name'; will do everything or do i have to change the providers and all. I dont wish to use multiple authentication like admin, customers etc i just want one authentication model but not with the table "users". I am preparing an application which has multiple type of users like admin, astrologers and users. all of them have different attributes so i

how to apply css class to laravel collective select

我的梦境 提交于 2021-02-07 06:23:47
问题 i used laravel 5.3 for my project, i used laravel form collective into it code is below {{ Form::select('size', ['surat' => 'surat', 'mumbai' => 'mumbai','hongkong' => 'hongkong'], 'hongkong',['multiple'=>'true'], array('class'=> 'form-control') ) }} but the array('class'=> 'form-control') is not working for me if i removed ['multiple'=>'true'] then it work properly so how can i apply bootstrap class to my select box. 回答1: The correct syntax: {!! Form::select('size', $citiesArray, 'hongkong',

how to apply css class to laravel collective select

白昼怎懂夜的黑 提交于 2021-02-07 06:23:05
问题 i used laravel 5.3 for my project, i used laravel form collective into it code is below {{ Form::select('size', ['surat' => 'surat', 'mumbai' => 'mumbai','hongkong' => 'hongkong'], 'hongkong',['multiple'=>'true'], array('class'=> 'form-control') ) }} but the array('class'=> 'form-control') is not working for me if i removed ['multiple'=>'true'] then it work properly so how can i apply bootstrap class to my select box. 回答1: The correct syntax: {!! Form::select('size', $citiesArray, 'hongkong',

How to send Multiple parameters in passes function of custom validation rule

自古美人都是妖i 提交于 2021-02-05 07:14:26
问题 I am implementing a custom validation rule which should take another parameter with attribute and value in passes function of custom validation rule. As we implement Rule interface while writing custom validations, it does not allow us to add third parameter in passes function but I need third parameter. Moreover, I will feel happy if anyone can guide me about the best practice of including database in rule. Either we should include only desired model in rule if we need a table in custom

htmlspecialchars() expects parameter 1 to be string, array given in Laravel

陌路散爱 提交于 2021-01-27 22:05:00
问题 I have got this error in my Laravel blade template htmlspecialchars() expects parameter 1 to be string, array given I have tried to convert the array into string in blade template. Here is the code <script> var value = {{ $sliderImageDataArray }}.toString() window.MedicPressSliderCaptions = value; </script> Where $silderImageDataArray is the variable and value stored here. Here is the $silderImageDataArray value [{"title":"First title","text":"<p><span id=\"hs_cos_wrapper_module