laravel-5.3

How to use API Routes in Laravel 5.3

99封情书 提交于 2019-11-28 05:35:56
In Laravel 5.3 API routes were moved into the api.php file. But how can I call a route in api.php file? I tried to create a route like this: Route::get('/test',function(){ return "ok"; }); I tried the following URLs but both returned the NotFoundHttpException exception: http://localhost:8080/test/public/test http://localhost:8080/test/public/api/test How can I call this API route? You call it by http://localhost:8080/api/test ^^^ If you look in app/Providers/RouteServiceProvider.php you'd see that by default it sets the api prefix for API routes, which you can change of course if you want to.

How to change reset password email subject in laravel?

怎甘沉沦 提交于 2019-11-28 05:04:29
I am beginner in Laravel. Currently I am learning this framework. My curent Laravel version is 5.3. I am scaffolding my auth by using php artisan make:auth All are working fine. Also I configured gmail smtp in my .env file and mail.php in config directgory. All are perfectly working. But I saw by-default the forgot password email subject is going Reset Password . I want to change that. I saw some blog. I found some blog. I have implement that in my site. But same output coming. I followed these links - https://laracasts.com/discuss/channels/general-discussion/laravel-5-password-reset-link

laravel 5.3 new Auth::routes()

吃可爱长大的小学妹 提交于 2019-11-28 02:48:45
Recently I start to use laravel 5.3 to write a blog, but I have a question after run php artisan make:auth when I run this, it will generate routes in my web.php this is the code in it: Auth::routes(); Route::get('/home', 'HomeController@index'); Then I run php artisan route:list , I find lots of actions, like LoginController@login... But I didn't find these actions in my App\Http\Controllers\Auth , where are these? And also what is the Auth::routes() stand for, I can't find the routes about Auth. I need someone help, thank you to answer my question Lee Auth::routes() is just a helper class

How to solve Missing argument 1 for App\\Repositories\\FavoriteRepository::delete() ? (Laravel 5.3)

我怕爱的太早我们不能终老 提交于 2019-11-28 02:24:47
My service is like this : public function delete($store_id) { $result = $this->favorite_repository->delete($store_id); dd($result); } My repository is like this : public function delete($store_id) { $data = self::where('favoritable_id', $store_id)->delete(); return $data; } There exist error : Missing argument 1 for App\Repositories\FavoriteRepository::delete(), called in C:\xampp\htdocs\mysystem\app\Repositories\FavoriteRepository.php on line 45 and defined Can you help me? UPDATE The delete function in the EloquentRepository is like this : public function delete($id) { // Find the given

How to update data on a page without refreshing on the vue.js?

隐身守侯 提交于 2019-11-28 01:45:26
My view is like this : <div class="favorite" style="margin-bottom:5px;"> @if (Auth::user()) <add-favorite-store :id-store="{{ $store->id }}"></add-favorite-store> @else <a href="javascript:" class="btn btn-block btn-success"> <span class="fa fa-heart"></span> Favorite </a> @endif </div> My component is like this : <template> <a href="javascript:" class="btn btn-block btn-success" @click="addFavoriteStore($event)"> <span class="fa fa-heart"></span> <label id="favoriteId">{{ store_id == 'responseFound' ? 'Un-Favorite' : 'Favorite' }}</label> </a> </template> <script> export default{ props:[

How to pass laravel CSRF token value to vue

蓝咒 提交于 2019-11-27 19:46:00
I have this form where the user should only type text inside a text area: <form action="#" v-on:submit="postStatus">{{-- Name of the method in Vue.js --}} <div class="form-group"> <textarea class="form-control" rows="5" maxlength="140" autofocus placeholder="What are you upto?" required v-model="post"></textarea> </div> <input type="submit" value="Post" class="form-control btn btn-info"> {{ csrf_field() }} </form> Then, I have this script code where I am using vue.js with ajax in order to pass that text into a controller and eventually save it into the database: //when we actually submit the

The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. laravel 5.3

戏子无情 提交于 2019-11-27 18:41:11
I installed a new fresh copy of laravel 5.3 using composer but I keep getting this error: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. Even though my app.php file in config directory specify 'cipher' => 'AES-128-CBC', You need to have .env on your appication folder then run: $ php artisan key:generate If you don't have .env copy from .env.example : $ cp .env.example .env Run this commands on your terminal: php artisan config:clear then php artisan config:cache Cengkuru Michael Run php artisan key:generate . Do php artisan config:clear , Then php

Multiple Authentication in Laravel 5.3

醉酒当歌 提交于 2019-11-27 16:55:39
问题 How to setup multiple authentication in Laravel 5.3 for two different tables(Users and Admin). By default Laravel has User Model. 回答1: Looks like you need to implements roles. You can use the default Laravel User Model and will need to create a Role Model: User Model ... public function role() { return $this->belongsToMany('App\User', 'user_roles', 'role_id', 'user_id'); } public function inRole($role) { return (bool) $this->role()->where('name', '=', $role)->count(); } ... Role Model ...

How to display button link with vue.js?

牧云@^-^@ 提交于 2019-11-27 16:30:52
My view is like this : <div class="panel panel-default panel-store-info"> ... <div id="app"> <AddFavoriteProduct></AddFavoriteProduct> </div> .... </div> My component is like this : <template> <a href="javascript:" class="btn btn-block btn-success" @click="addFavoriteProduct({{ $product->id }})"> <span class="fa fa-heart"></span> Favorite </a> </template> <script> export default{ name: 'AddFavoriteProduct', props:['idProduct'], methods:{ addFavoriteProduct(event){ event.target.disabled = true const payload= {id_product: this.idProduct} this.$store.dispatch('addFavoriteProduct', payload)

Passport - “Unauthenticated.” - Laravel 5.3

浪尽此生 提交于 2019-11-27 16:07:07
问题 I hope someone could explain why I'm unauthenticated when already has performed a successfull Oauth 2 authentication process. I've set up the Passport package like in Laravel's documentation and I successfully get authenticated, receives a token value and so on. But, when I try to do a get request on, let say, /api/user , I get a Unauthenticated error as a response. I use the token value as a header with key name Authorization , just as described in the docs. Route::get('/user', function