Laravel - voyager BREAD - php

I started my simple laravel project with posts. First I created my auth, than my posts and everything works fine. But I installed voyager admin panel(without dummy) in my project and I add BREAD to posts table, but when I try to Edit some of my posts it shows me an error: Call to undefined method App\Post::getTranslationsOf() (View: C:\engineering\xampp\htdocs\lsappdev\vendor\tcg\voyager\resources\views\posts\edit-add.blade.php). Why is this error showing?
Here is my PostsController:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use App\Post;
use DB;
class PostsController extends Controller
{
/**
* Create a new controller instance.
*
* #return void
*/
public function __construct()
{
$this->middleware('auth', ['except' => ['index', 'show']]);
}
/**
* Display a listing of the resource.
*
* #return \Illuminate\Http\Response
*/
public function index()
{
$posts = Post::all();
return view('posts.index')->with('posts', $posts);
}
/**
* Show the form for creating a new resource.
*
* #return \Illuminate\Http\Response
*/
public function create()
{
return view('posts.create');
}
/**
* Store a newly created resource in storage.
*
* #param \Illuminate\Http\Request $request
* #return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this->validate($request, [
'title' => 'required',
'description' => 'required',
'cover_image' => 'image|nullable|max:1999'
]);
// Handle File Upload
if($request->hasFile('cover_image')){
// Get filename with the extension
$filenameWithExt = $request->file('cover_image')->getClientOriginalName();
// Get just filename
$filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
// Get just ext
$extension = $request->file('cover_image')->getClientOriginalExtension();
// Filename to store
$fileNameToStore= $filename.'_'.time().'.'.$extension;
// Upload Image
$path = $request->file('cover_image')->storeAs('public/cover_images', $fileNameToStore);
} else {
$fileNameToStore = 'noimage.jpg';
}
$post = new Post;
$post->title = $request->input('title');
$post->description = $request->input('title');
$post->user_id = auth()->user()->id;
$post->cover_image = $fileNameToStore;
$post->save();
return redirect('/posts');
}
/**
* Display the specified resource.
*
* #param int $id
* #return \Illuminate\Http\Response
*/
public function show($id)
{
$post = Post::find($id);
return view('posts.show')->with('post', $post);
}
/**
* Show the form for editing the specified resource.
*
* #param int $id
* #return \Illuminate\Http\Response
*/
public function edit($id)
{
$post = Post::find($id);
//Check if post exists before deleting
if (!isset($post)){
return redirect('/posts')->with('error', 'No Post Found');
}
// Check for correct user
if(auth()->user()->id !==$post->user_id){
return redirect('/posts')->with('error', 'Unauthorized Page');
}
return view('posts.edit')->with('post', $post);
}
/**
* Update the specified resource in storage.
*
* #param \Illuminate\Http\Request $request
* #param int $id
* #return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$this->validate($request, [
'title' => 'required',
'body' => 'required',
'cover_image' => 'image|nullable|max:1999'
]);
$post = Post::find($id);
// Handle File Upload
if($request->hasFile('cover_image')){
// Get filename with the extension
$filenameWithExt = $request->file('cover_image')->getClientOriginalName();
// Get just filename
$filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
// Get just ext
$extension = $request->file('cover_image')->getClientOriginalExtension();
// Filename to store
$fileNameToStore= $filename.'_'.time().'.'.$extension;
// Upload Image
$path = $request->file('cover_image')->storeAs('public/cover_images', $fileNameToStore);
// Delete file if exists
Storage::delete('public/cover_images/'.$post->cover_image);
}
$post->title = $request->input('title');
$post->body = $request->input('description');
if($request->hasFile('cover_image')){
$post->cover_image = $fileNameToStore;
}
$post->save();
return 123;
}
/**
* Remove the specified resource from storage.
*
* #param int $id
* #return \Illuminate\Http\Response
*/
public function destroy($id)
{
$post = Post::find($id);
//Check if post exists before deleting
if (!isset($post)){
return redirect('/posts')->with('error', 'No Post Found');
}
// Check for correct user
if(auth()->user()->id !==$post->user_id){
return redirect('/posts')->with('error', 'Unauthorized Page');
}
if($post->cover_image != 'noimage.jpg'){
// Delete Image
Storage::delete('public/cover_images/'.$post->cover_image);
}
$post->delete();
return redirect('/posts');
}
}
And here is my Post.php model:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Laravelista\Comments\Commentable;
class Post extends Model
{
use Commentable;
protected $table = 'posts';
protected $primaryKey = 'id';
protected $fillable = ['title', 'description', 'cover_image', 'user_id'];
public function user(){
return $this->belongsTo(User::class);
}
}
Please if anybody know a solution for this error help! Everything worked fine before I installed Voyager in my project.

You are using the voyager model. So in your post model at the top
Use \TCG\Voyager\Traits\Translatable;
And inside braces
Use Translatable;
Hope it helps

Related

Method Illuminate\Validation\Validator::validateImagetwo does not exist. i want to add two image

I want to add two images. I can upload one image but if I try to add two it shows an error. I want to add two images. I can upload one image but if I try to add two it shows an error. I want to add two images. I can upload one image but if I try to add two it shows an error. I want to add two images. I can upload one image but if I try to add two it shows an error. I want to add two images. I can upload one image but if I try to add two it shows an error.
<?php
namespace App\Http\Controllers;
use App\Models\Product;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Http\Requests\Admin\StoreTagsRequest;
class ProductController extends Controller
{
/**
* Display a listing of the resource.
*
* #return \Illuminate\Http\Response
*/
public function index()
{
//$tags = Product::all();
//return view('products.index', compact('tags'));
$products = Product::latest()->paginate(5);
return view('products.index',compact('products'))
->with('i', (request()->input('page', 1) - 1) * 5);
}
/**
* Show the form for creating a new resource.
*
* #return \Illuminate\Http\Response
*/
public function create()
{
return view('products.create');
}
/**
* Store a newly created resource in storage.
*
* #param \Illuminate\Http\Request $request
* #return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//$tag = Product::create($request->all());
//return redirect()->route('admin.tags.index');
$request->validate([
'name' => 'required',
'detail' => 'required',
'color' => 'required',
'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'imagetwo' => 'required|imagetwo|mimes:jpeg,png,jpg,gif,svg|max:512',
]);
$input = $request->all();
if ($image = $request->file('image')) {
$destinationPath = 'image/';
$profileImage = date('YmdHis') . "." . $image->getClientOriginalExtension();
$image->move($destinationPath, $profileImage);
$input['image'] = "$profileImage";
}
if ($imagetwo = $request->file('imagetwo')) {
$destinationPath = 'image/';
$profileImagetwo = date('YmdHis') . "." . $imagetwo->getClientOriginalExtension();
$imagetwo->move($destinationPath, $profileImagetwo);
$input['image'] = "$profileImagetwo";
}
Product::create($input);
return redirect()->route('products.index')
->with('success','Product created successfully.');
}
/**
* Display the specified resource.
*
* #param \App\Product $product
* #return \Illuminate\Http\Response
*/
public function show(Product $product)
{
return view('products.show',compact('product'));
}
/**
* Show the form for editing the specified resource.
*
* #param \App\Product $product
* #return \Illuminate\Http\Response
*/
public function edit(Product $product)
{
return view('products.edit',compact('product'));
}
/**
* Update the specified resource in storage.
*
* #param \Illuminate\Http\Request $request
* #param \App\Product $product
* #return \Illuminate\Http\Response
*/
public function update(Request $request, Product $product)
{
$request->validate([
'name' => 'required',
'detail' => 'required',
'color' => 'required'
]);
$input = $request->all();
if ($image = $request->file('image')) {
$destinationPath = 'image/';
$profileImage = date('YmdHis') . "." . $image->getClientOriginalExtension();
$image->move($destinationPath, $profileImage);
$input['image'] = "$profileImage";
}else{
unset($input['image']);
}
if ($imagetwo = $request->file('imagetwo')) {
$destinationPath = 'imagetwo/';
$profileTmagetwo = date('YmdHis') . "." . $imagetwo->getClientOriginalExtension();
$image->move($destinationPath, $profileTmagetwo);
$input['imagetwo'] = "$profileTmagetwo";
}else{
unset($input['imagetwo']);
}
$product->update($input);
return redirect()->route('products.index')
->with('success','Product updated successfully');
}
/**
* Remove the specified resource from storage.
*
* #param \App\Product $product
* #return \Illuminate\Http\Response
*/
public function destroy(Product $product)
{
$product->delete();
return redirect()->route('products.index')
->with('success','Product deleted successfully');
}
function indextwo(){
//return DB::select("select * from products");
//DB::table('products')->orderBy('id','desc')->first();
return Product::orderBy('id', 'DESC')->first();
}
}
You should remove imgTwo from your validation because it does not exist, why would you put it here? tell me the reason so I can provide solution
'imagetwo' => 'required|mimes:jpeg,png,jpg,gif,svg|max:512',

Why hyperlinks for download PDF not working ? (no file)

I developed system for creating articles, each post except title and content consist possibility for uploading PDF.File names are stored in the database and they are written on the hyperlinks necessary to download the file.Now the problem is that when I want to download the file, it shows me a mistake in the browser.
Did anyone knows what is a problem ?
Database
Location of PDF files
result
Posts Controller
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
//including post model to controller
use App\Post;
//if we want to use sql syntax for queries
use DB;
class PostsController extends Controller
{
/**
* Display a listing of the resource.
*
* #return \Illuminate\Http\Response
*/
public function index()
{
//list articles by desc row
$posts= Post::orderby('created_at', 'desc')->paginate(3);
return view('posts.index')-> with('posts', $posts);
}
/**
* Show the form for creating a new resource.
*
* #return \Illuminate\Http\Response
*/
public function create()
{
return view('posts.create');
}
/**
* Store a newly created resource in storage.
*
* #param \Illuminate\Http\Request $request
* #return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this -> validate($request,[
'title' => 'required',
'content' => 'required'
]);
// Handle File Upload
if($request->hasFile('image')){
// Get filename with the extension
$filenameWithExt = $request->file('image')->getClientOriginalName();
// Get just filename
$filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
// Get just ext
$extension = $request->file('image')->getClientOriginalExtension();
// Filename to store
$fileNameToStore= $filename.'_'.time().'.'.$extension;
// Upload Image
$path = $request->file('image')->storeAs('public/upload', $fileNameToStore);
} else {
$fileNameToStore = 'noimage.jpg';
}
//create new post
$post= new Post;
$post -> title = $request -> input('title');
$post -> content = $request -> input('content');
$post->file_name = $fileNameToStore;
$post -> save();
return redirect('/posts') ->with('success', 'Post Created');
}
/**
* Display the specified resource.
*
* #param int $id
* #return \Illuminate\Http\Response
*/
public function show($id)
{
//list post while we enter through link
$post= Post::find($id);
return view('posts.show')-> with('post', $post);
}
/**
* Show the form for editing the specified resource.
*
* #param int $id
* #return \Illuminate\Http\Response
*/
public function edit($id)
{
$post= Post::find($id);
return view('posts.edit')-> with('post', $post);
}
/**
* Update the specified resource in storage.
*
* #param \Illuminate\Http\Request $request
* #param int $id
* #return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$this -> validate($request,[
'title' => 'required',
'content' => 'required'
]);
//create new post
$post= Post::find($id);
$post -> title = $request -> input('title');
$post -> content = $request -> input('content');
$post -> save();
return redirect('/posts') ->with('success', 'Post Updated');
}
/**
* Remove the specified resource from storage.
*
* #param int $id
* #return \Illuminate\Http\Response
*/
public function destroy($id)
{
$post= Post::find($id);
$post -> delete();
return redirect('/posts') ->with('success', 'Post Removed');
}
}
show.blade.php
#extends('layouts.app')
#section('content')
<h1>{{$post->title}}</h1>
<div>
{{$post->content}}
</div>
<p><a href="./storage/app/public/upload/{{$post->file_name}}" download>Download the pdf</a></p>
<small>Written on {{$post->created_at}}</small>
Return
#endsection
Migration Create Post
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePostsTable extends Migration
{
/**
* Run the migrations.
*
* #return void
*/
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->mediumText('content');
$table->string('file_name')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* #return void
*/
public function down()
{
Schema::dropIfExists('posts');
}
}
storage/app/public is not visible to the user
You need to either move to public/... and/or create a symbolic link using this instructions: https://laravel.com/docs/5.7/filesystem#the-public-disk
php artisan storage:link
Then you replace
<a href="./storage/app/public/upload/{{$post->file_name}}" download>
With
<a href="{{asset('storage/upload/'.$post->file_name)}}" download>

How to insert data into multiple table in laravel from single Controller?

[I am new in Laravel]
I am using Laravel 5.5
I have ProductController and model Product also I have two tables products and pcategories. I want to insert data into pcategories table from ProductController. How to do this properly? I have used DB::table('pcategories')->enter code hereinsert($data); but it's not inserting created_at and updated_at value.
Another question: Can I call multiple models into a controller?
This is my controller
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use App\Product;
use Image;
class ProductController extends Controller {
/**
* Display a listing of the resource.
*
* #return \Illuminate\Http\Response
*/
public function index() {
$product->categorieslist = Product::table('pcategories')->get();
return view('product.add')->with($data);
}
/**
* Show the form for creating a new resource.
*
* #return \Illuminate\Http\Response
*/
public function create() {
$product->categorieslist = Product::table('pcategories')->get();
return view('product.add')->with($data);
}
public function all() {
$product->products = Product::table('products')->get();
return view('product.all', $data);
}
/**
* Store a newly created resource in storage.
*
* #param \Illuminate\Http\Request $request
* #return \Illuminate\Http\Response
*/
public function store(Request $request) {
$this->validate($request, [
'producttitle' => 'required',
'price' => 'required',
'photo' => 'image|mimes:jpeg,png,jpg,gif,svg',
]);
$product = new Product;
$image = $request->file('photo');
if ($request->file('photo')) {
$product->photo = time() . '.' . $image->getClientOriginalExtension();
$imagePath = public_path('/images/product');
$img = Image::make($image->getRealPath());
$img->resize(250, 250, function ($constraint) {
$constraint->aspectRatio();
})->save($imagePath . '/' . $product->photo);
}
$product->title = $request->input('producttitle');
$product->description = $request->input('description');
$product->category = $request->input('category');
$product->price = $request->input('price');
$product->saleprice = $request->input('saleprice');
$product->weight = $request->input('weight');
$product->dimension = $request->input('dimension');
$product->color = $request->input('color');
$product->save();
return redirect('/product/')->with('success', 'Successfully Added');
}
/**
* Display the specified resource.
*
* #param int $id
* #return \Illuminate\Http\Response
*/
public function show($id) {
$product = Product::find($id);
return view('product.show')->with('product', $product);
}
/**
* Show the form for editing the specified resource.
*
* #param int $id
* #return \Illuminate\Http\Response
*/
public function edit($id) {
$data['product'] = Product::find($id);
$data['categorieslist'] = Product::table('pcategories')->get();
return view('product.edit')->with($data);
}
/**
* Update the specified resource in storage.
*
* #param \Illuminate\Http\Request $request
* #param int $id
* #return \Illuminate\Http\Response
*/
public function update(Request $request, $id) {
$this->validate($request, [
'producttitle' => 'required',
'price' => 'required',
'photo' => 'image|mimes:jpeg,png,jpg,gif,svg',
]);
$product = Product::find($id);
$image = $request->file('photo');
if ($request->file('photo')) {
$product->photo = time() . '.' . $image->getClientOriginalExtension();
$imagePath = public_path('/images/product');
$img = Image::make($image->getRealPath());
$img->resize(250, 250, function ($constraint) {
$constraint->aspectRatio();
})->save($imagePath . '/' . $product->photo);
}
$product->title = $request->input('producttitle');
$product->description = $request->input('description');
$product->category = $request->input('category');
$product->price = $request->input('price');
$product->saleprice = $request->input('saleprice');
$product->weight = $request->input('weight');
$product->dimension = $request->input('dimension');
$product->color = $request->input('color');
$product->save();
return redirect('/product/all')->with('success', 'Successfully Updated');
}
/**
* Remove the specified resource from storage.
*
* #param int $id
* #return \Illuminate\Http\Response
*/
public function destroy($id) {
Product::find($id)->delete();
return redirect('/product/all')->with('success', 'Successfully Deleted');
}
public function category() {
$data['categories'] = DB::table('pcategories')->get();
return view('product.category')->with($data);
}
public function storecategory(Request $request) {
$this->validate($request, [
'category' => 'required',
]);
$data = array();
$data['category'] = $request->input('category');
DB::table('pcategories')->insert($data);
return redirect('/product/category')->with('success', 'Successfully Added');
}
public function categorydestroy($id) {
DB::table('pcategories')->where('id', $id)->delete();
return redirect('product/category/')->with('success', 'Successfully Deleted');
}
}
Use Eloquent Model instead of Query Builder. Fields created_at,updated_at are "part" of Eloquent. You either use Eloquent or insert manually those fields.
If you want to use Eloquent, then make two model Product and PCategory. And then insert with your model.
PCategory::create($data);
And you need to mass assigned your field on model class.If you don't want to mass assigned your fields, than do like this-
$pcategory = new PCategory();
//$pcategory->column1 = $data['column1'] or $data->column1;
$pcategory->save();
To learn more, follow this official doc.
And for your second part, Yes, You can.
First, create a proper relationship with your models ( one to many, etc. )
Second, you can use the DB::transact to insert data into multiple tables in DB. It has it's own advantages rather than just inserting Fk in tables to fill in the data. For further info you can search in google.

Laravel 5.4 : ReflectionException in Container.php line 749: Class App\Http\Controllers\Admin\ImageGalleryController does not exist

I'm fed up with this error, used a admin and user login project and got this error.
Laravel 5.4 : ReflectionException in Container.php line 749: Class App\Http\Controllers\Admin\ImageGalleryController does not exist
please look into my files.
This is the Screenshot of the error:
Routes for Gallery Upload:
Route::get('gallery-upload', 'ImageGalleryController#index');
Route::post('/gallery-upload', 'ImageGalleryController#upload');
Route::delete('/gallery-upload/{id}', 'ImageGalleryController#destroy');
Controller File:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\ImageGallery;
class ImageGalleryController extends Controller
{
/**
* Listing Of images gallery
*
* #return \Illuminate\Http\Response
*/
public function index()
{
$images = ImageGallery::get();
return view('gallery-upload',compact('images'));
}
public function img()
{
$images = ImageGallery::get();
return view('gallery',compact('images'));
}
// /**
// * Upload image function
// *
// * #return \Illuminate\Http\Response
public function upload(Request $request)
{
$this->validate($request, [
'title' => 'required',
'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
]);
$input['image'] = time().'.'.$request->image->getClientOriginalExtension();
$request->image->move(public_path('images'), $input['image']);
$input['title'] = $request->title;
ImageGallery::create($input);
return back()
->with('success','Image Uploaded successfully.');
}
/**
* Remove Image function
*
* #return \Illuminate\Http\Response
*/
public function destroy($id)
{
ImageGallery::find($id)->delete();
return back()
->with('success','Image removed successfully.');
}
}
Route File
Route::get('gallery-upload', 'Admin\ImageGalleryController#index');
Route::post('/gallery-upload', 'Admin\ImageGalleryController#upload');
Route::delete('/gallery-upload/{id}', 'Admin\ImageGalleryController#destroy');
Controller File :
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\ImageGallery;
class ImageGalleryController extends Controller
{
/**
* Listing Of images gallery
*
* #return \Illuminate\Http\Response
*/
public function index()
{
$images = ImageGallery::get();
return view('gallery-upload',compact('images'));
}
public function img()
{
$images = ImageGallery::get();
return view('gallery',compact('images'));
}
// /**
// * Upload image function
// *
// * #return \Illuminate\Http\Response
public function upload(Request $request)
{
$this->validate($request, [
'title' => 'required',
'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
]);
$input['image'] = time().'.'.$request->image->getClientOriginalExtension();
$request->image->move(public_path('images'), $input['image']);
$input['title'] = $request->title;
ImageGallery::create($input);
return back()
->with('success','Image Uploaded successfully.');
}
/**
* Remove Image function
*
* #return \Illuminate\Http\Response
*/
public function destroy($id)
{
ImageGallery::find($id)->delete();
return back()
->with('success','Image removed successfully.');
}
}
Your namespace looks like it's wrong, I don't see Admin in it anywhere, which is what the application is looking for.
App\Http\Controllers\ImageGalleryController
not
App\Http\Controllers\Admin\ImageGalleryController

Method [all] does not exist in Laravel 5.2

just now I get this issues that is bothering me.
the error in code after validator::make in update function.
BadMethodCallException in Controller.php line 107: Method [all] does
not exist.
This is the full code from BooksController
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Redirect;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\book;
class BooksController extends Controller
{
/**
* Display a listing of the resource.
*
* #return Response
*/
public function index()
{
$book = BooksController::all();
return view('book.index')->with('book', $book);
}
/**
* Show the form for creating a new resource.
*
* #return Response
*/
public function create()
{
return view('book.create');
}
/**
* Store a newly created resource in storage.
*
* #return Response
*/
public function store()
{
$rules = array(
'judul' => 'required',
'author' => 'required',
'penerbit' => 'required'
);
$validator = Validator::make(Input::all(), $rules);
// process the login
if ($validator->fails()) {
return Redirect::to('book/create')
->withErrors($validator)
->withInput(Input::except('password'));
} else {
// store
$book = new book;
$book ->judul = Input::get('judul');
$book ->author = Input::get('author');
$book ->penerbit = Input::get('penerbit');
$book ->save();
// redirect
Session:flash('message', 'Berhasil membuat buku!');
return Redirect::to('book');
}
}
/**
* Display the specified resource.
*
* #param int $idate
* #return Response
*/
public function show($id)
{
$book = books::find($id);
return view('book.show')
->with('book', $book);
}
/**
* Show the form for editing the specified resource.
*
* #param int $id
* #return Response
*/
public function edit($id)
{
$book = books::find($id);
return view('book.edit')
->with('book', $book);
}
/**
* Update the specified resource in storage.
*
* #param int $id
* #return Response
*/
public function update($id)
{
$rules = array(
'judul' => 'required',
'author' => 'required',
'penerbit' => 'required'
);
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::to('book/' . $id . '/edit')
->withErrors($validator)
->withInput(Input::except('password'));
} else {
// simpan
$book = books::find($id);
$book->judul = Input::get('judul');
$book->author = Input::get('author');
$book->penerbit = Input::get('penerbit');
$book->save();
// redirect
Session::flash('message', 'Berhasil mengganti info buku!');
return Redirect::to('book');
}
}
/**
*
* #param int $id
* #return Response
*/
public function destroy($id)
{
$book = books::find($id);
$book ->delete();
//redirect
Session::flash('message', 'Berhasil menghapus buku!');
return Redirect::to('book');
}
}
try this use Validator; instead of
use Illuminate\Support\Facades\Validator;
convert user Input::all() to input()->all() or request()->all()

Categories