laravel-5.3

Uninstall Laravel Valet

三世轮回 提交于 2019-12-02 18:25:21
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 server DNS address could not be found. So I decided to uninstall it by running $ valet uninstall , it

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

不打扰是莪最后的温柔 提交于 2019-12-02 17:26:44
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 constants. The .env method. Or adding the constant.php file? Thanks For most constants used globally across the

Why wheredate not working in laravel 5.3?

南笙酒味 提交于 2019-12-02 15:57:47
问题 My laravel eloquent is like this : public function search(Request $request) { $search = ''; $searchdate = '2017-04-27'; $reports = Report::whereHas('user', function($query) use ($search) { $query->where(function ($q) use($search) { $q->where('name' ,'LIKE' ,'%'.$search.'%'); }); })->orWhereHas('store', function($query) use ($search){ $query->where(function ($q) use($search) { $q->where('name', 'LIKE', '%'.$search.'%'); }); })->orWhereHas('category', function($query) use ($search) { $query-

How can I solve “Type error: Argument 1 passed to App\Http\Controllers\Controller::validate() must be an instance of Illuminate\Http\Request,”?

旧巷老猫 提交于 2019-12-02 15:21:47
问题 My code like this : public function functionA(Request $request) { ... if($request->get('data')) { //echo '<pre>';print_r($request->get('data'));echo '</pre>';die(); $data = json_decode($request->get('data'), true); $data = collect($data['data']); $this->validate($data, [ 'id'=>'required|numeric', 'quantity'=>'required|numeric', ]); $input = $data->only('id', 'quantity','request_date'); ... } } The result of echo '<pre>';print_r($request->get('data'));echo '</pre>';die(); like this : {"data":{

How can I color input fields border red when I get validation error laravel 5.3

社会主义新天地 提交于 2019-12-02 14:31:10
问题 My Validation Controller: public function store(Request $request) { // dd($request->all()); /////Validations//// $this->Validate($request, [ 'name' => 'required|min:3|', 'email' => 'required|unique:customers' , 'favorite' => 'required', 'Password' => 'required|min:6', 'Confirm_Password' => 'required|same:Password', ]); $user = new customer; $user ->name=input::get("name"); $user ->email=input::get("email"); $user ->country=input::get("country"); $user ->gender=input::get("gender"); $user -

Remove @include depending on the route

戏子无情 提交于 2019-12-02 13:44:45
问题 I have a menu partial, that includes a input search bar. But i don't want the search bar to be visibel on all pages, only for two specific uri´s. Is there a way to remove that include in blade? Currently it looks like this: <a href="{{ route('all') }}">all</a> <a href="{{ route('nes') }}">nes</a> <a href="{{ route('snes') }}">snes</a> @include('partials._search') I was thinking something like <a href="{{ route('all') }}">all</a> <a href="{{ route('nes') }}">nes</a> <a href="{{ route('snes') }

Summation query using groupBy() function in laravel

荒凉一梦 提交于 2019-12-02 12:52:16
A table where X, Y and Z have some individual amounts. Sample data: Name | Amount | Date —————|————————|————————— X | 100 | 15-11-17 Y | 50 | 15-11-17 X | 50 | 15-11-17 Z | 70 | 15-11-17 Z | 30 | 15-11-17 Now I want to show a table where X will return one row with the summation of it's two values in the same date. Expected result: Name | Amount | Date —————|————————|————————— X | 150 | 15-11-17 Y | 50 | 15-11-17 Z | 100 | 15-11-17 So what is the laravel query for that? I use groupBy(). But can't get the targeted result. Here is my laravel query code $data = DB::table('transactions') ->select(

How can I solve “Type error: Argument 1 passed to App\\Http\\Controllers\\Controller::validate() must be an instance of Illuminate\\Http\\Request,”?

匆匆过客 提交于 2019-12-02 11:27:40
My code like this : public function functionA(Request $request) { ... if($request->get('data')) { //echo '<pre>';print_r($request->get('data'));echo '</pre>';die(); $data = json_decode($request->get('data'), true); $data = collect($data['data']); $this->validate($data, [ 'id'=>'required|numeric', 'quantity'=>'required|numeric', ]); $input = $data->only('id', 'quantity','request_date'); ... } } The result of echo '<pre>';print_r($request->get('data'));echo '</pre>';die(); like this : {"data":{"id":46,"quantity":1,"total":100000,"information":"chelsea","name":"Hazard","request_date":"14-08-2017

Laravel 5.3 Custom Path for Post-authentication Redirect

别说谁变了你拦得住时间么 提交于 2019-12-02 10:08:12
问题 I have two types of users: "vendors" and "clients". And I'm currently using Laravel's built-in Auth Controllers (from the make:auth command) to do my client user authentication. And since I have two kinds of users, I have changed the $redirectTo property on the LoginController , RegisterController , and ResetPasswordController to /client/home . Here is proof: RegisterController LoginController Now, it redirects to /client/home every time I successfully do registration, login, and password

Why the slider does not work when I click another tab on vue component?

▼魔方 西西 提交于 2019-12-02 10:04:54
My view like this : @foreach($leagues as $league) <a data-toggle="tab" @click="$refs.leagues.changeLeague({{ $league->id }})"> {{ $league->name }} </a> @endforeach ... <div class="tab-pane active"> <top-league class="slick" league-id="{{ $league_id }}" ref="leagues"></top-league> </div> My top league component vue like this : <template> <div class="row"> <div class="col-md-3" v-for="item in items"> <div class="panel panel-default"> <div class="panel-image"> <a :href="baseUrl+'/leagues/'+item.id+'/'+item.name" :style="{backgroundImage: 'url(' + baseUrl + '/img/leagues/'+item.photo+ ')'}"> </a>