samedi 1 septembre 2018

already define the route but, error is not define

I have already define the route but, error is not define the route. Let me explain you what i have done my code.

ROUTE:

Route::post( '/member/import-single-trades', 'trades\ImportSingleTradesController@tradesImport')->name('member.add-single-trade.import-excel.import_fields');

<form class="form-horizontal" method="POST" action="" enctype="multipart/form-data">
                            

Now ERROR is :

Route [member/import-single-trades] not defined. (View: C:\xampp\htdocs\development\fresh\ytl\resources\views\member\add-single-trade\import-excel\import.blade.php)



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2CedkNs
via IFTTT

class not found when i am using Requests\CsvImportRequest

Error of class not found when i am passing parameter to function

error :

Class App\Http\Requests\CsvImportRequest does not exist

What should I for this error for my controller, I am pasting here what i done :

<?php
    namespace App\Http\Controllers\trades;

    use App\Contact;
    use App\CsvData;
    use App\Http\Requests\CsvImportRequest;
    use Illuminate\Http\Request;
    use Maatwebsite\Excel\Facades\Excel;
    use App\Http\Controllers\Controller;



    class ImportSingleTradesController extends Controller
    {

        public function tradesImport(CsvImportRequest $request)
        {
            $path = $request->file('csv_file')->getRealPath();
            if ($request->has('header')) {
                $data = Excel::load($path, function($reader) {})->get()->toArray();
            } else {
                $data = array_map('str_getcsv', file($path));
            }
            if (count($data) > 0) {
                if ($request->has('header')) {
                    $csv_header_fields = [];
                    foreach ($data[0] as $key => $value) {
                        $csv_header_fields[] = $key;
                    }
                }
                $csv_data = array_slice($data, 0, 2);
                $csv_data_file = CsvData::create([
                    'csv_filename' => $request->file('csv_file')->getClientOriginalName(),
                    'csv_header' => $request->has('header'),
                    'csv_data' => json_encode($data)
                ]);
            } else {
                return redirect()->back();
            }
            return view('member.add-single-trade.import-excel.import_fields', compact( 'csv_header_fields', 'csv_data', 'csv_data_file'));

        }



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2C7LfHM
via IFTTT

Laravel 5 Error installing wapnen/google-cloud-vision-php

I'm using Laravel 5.3, I want to install wapnen/google-cloud-vision-php, when i add composer require wapnen/google-cloud-vision-php, it come out with the error Could not find package wapnen/google-cloud-vision-php at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability. What do that mean?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2PQ6cKd
via IFTTT

laravel 5.6 Class App\Http\Controllers\PostController does not exist

I have search and found this Question ask before but did not solve my problem composer update and composer dumpautoload did not solve I am creating CMS base website I have created PostsController at create method I return a view And the route is bellow:

  Route::get('/post/create',[
'uses' => 'PostController@create',
'as' =>  'post.create'

]);]

this is PostsController@create

<?php

namespace App\Http\Controllers;
namespace App\Http\Controllers\PostController;
use Illuminate\Http\Request;
use Illuminate\Http\Controllers;


class PostsController extends Controller
 {
  /**
   * Display a listing of the resource.
   *
   * @return \Illuminate\Http\Response
   */
   public function index()
     {
       //
      }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
     public function create()
         {
           return view('admin.posts.create');
             }

Error screenshot at browser

Please don't say this question has been asked help me I have choked laracast but did not work link is bellow

https://laracasts.com/discuss/channels/general-discussion/reflectionexception-class-apphttpcontrollersadminadmincontroller-does-not-exist



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2wzVsXl
via IFTTT

How to fix Undefined variable: request in laravel 5.6

I am going to filter data with districtname in my vehicles table like this,

public function index()
    {
       $vehicles = Vehicle::with('uploads')
                ->when($request->district, function ($query, $request) {
                    return $query->where('districtname', $request->district);
                })->get();

        return view('vehicles.index')->withVehicles($vehicles);
    }

and my vehicle table like this,

id  districtname  vehiclename 
1    alabama          toyota
2    alamaba          ford
3    miyuri           bmw
4    misisipi         benz
5    miyuri           ford
6    alabama          toyota

and routes is like this,

Route::get('district', [
    'uses' => 'VehicleController@index',
    'as'   => 'districts.index',

]);

but got following error msg,

Undefined variable: request
in VehicleController.php line 39

how can fix this???



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2wzG2T2
via IFTTT

Vue.js not reactive in laravel

I'm new to Vue and i'm trying to bind some inputs to data. everything shows up correctly in the browser but the binding doesn't seem to work. it's not reacting when i'm changing a input field. see my code below.

I'm also using the debug extension for Google Chrome and the Login component is not visible in here only the root component.

I hope you guys can help me out :)

app.js

require('./bootstrap');

window.Vue = require('vue');
window.VueRouter = require('vue-router').default;
window.axios = require('axios');

Vue.use(VueRouter);

const login = Vue.component('login', require('./components/Login.vue'));


const router = new VueRouter({
    mode: 'history',
    routes: [
        {
            name: "login",
            path: "/admin",
            component: login
        }
    ]
})

const app = new Vue({
    el: '#app',
    router: router
});

Login.vue

<template>
   <div class="wrapper-page">

            <div class="text-center">
                <a href="index.html" class="logo-lg"><i class="mdi mdi-radar"></i> <span>Minton</span> </a>
            </div>

            <!-- <form class="form-horizontal m-t-20" action="index.html"> -->

                <div class="form-group row">
                    <div class="col-12">
                        <div class="input-group">
                            <div class="input-group-prepend">
                                <span class="input-group-text"><i class="mdi mdi-account"></i></span>
                            </div>
                            <input v-model="email" class="form-control" type="email" required="" placeholder="e-mail">
                        </div>
                    </div>
                </div>

                <div class="form-group row">
                    <div class="col-12">
                        <div class="input-group">
                            <div class="input-group-prepend">
                                <span class="input-group-text"><i class="mdi mdi-radar"></i></span>
                            </div>
                            <input v-model="password" class="form-control" type="password" required="" placeholder="Password">
                        </div>
                    </div>
                </div>

                <div class="form-group row">
                    <div class="col-12">
                        <div class="checkbox checkbox-primary">
                            <input id="checkbox-signup" type="checkbox">
                            <label for="checkbox-signup">
                                Remember me
                            </label>
                        </div>

                    </div>
                </div>

                <div class="form-group text-right m-t-20">
                    <div class="col-xs-12">
                        <button class="btn btn-primary btn-custom w-md waves-effect waves-light" type="submit" v-on:submit="logIn();">Log In
                        </button>
                    </div>
                </div>

                <div class="form-group row m-t-30">
                    <div class="col-sm-7">
                        <a href="#" class="text-muted" v-on:click="logIn"><i class="fa fa-lock m-r-5"></i> Forgot your
                            password?</a>
                    </div>
                    <div class="col-sm-5 text-right">
                        <a href="pages-register.html" class="text-muted">Create an account</a>
                    </div>
                </div>
            <!-- </form> -->
            <pre>
                
            </pre>
        </div>
</template>

<script>

    export default {  
        name: "login",
        data(){
            return {
              email: '',
              password: ''
            }
          },
          methods: {
            logIn(){
                console.log(this.email);
            }
          }
        };
</script>



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2N8rALZ
via IFTTT

Multiple column with same string like search in laravel

SELECT * FROM table_name WHERE CONCAT(id,name, address) LIKE '%same_string%'

What is alternate query for this in laravel.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2NGgeMB
via IFTTT