laravel-5.2

Laravel 5.2 and ajax Failed to load resource: the server responded with a status of 500

时光怂恿深爱的人放手 提交于 2019-12-12 03:37:54
问题 Hi i m trying to make To do list application with laravel and ajax the probleme is if i tr to add,edit, delete a Task i get a Failed to load resource: the server responded with a status of 500 But when i click on the link with the error the returned data appears in json format View : <!DOCTYPE html> <html lang="en-US"> <head> <title>Laravel Ajax CRUD Example</title> <!-- Load Bootstrap CSS --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">

Laravel 5.2 | CSRF Token mismatch

僤鯓⒐⒋嵵緔 提交于 2019-12-12 03:37:50
问题 I'm using AJAX post request and sending with CSRF-TOKEN - on my local server worked well, but on my IIS SERV TokenMismatchException in VerifyCsrfToken.php line 67: This is the code: $.ajax({ url : '{{ route('dashboard.ajax.update') }}', method : 'POST', data : { table : 'categories', data : { order: $count }, conditions : { id: $id } }, dataType: 'JSON', headers : { "X-CSRF-TOKEN": '{{ csrf_token() }}' } }); In the console I can see the request with: X-CSRF-TOKEN

Laravel 5 creating custom registration and login from default Authentication

怎甘沉沦 提交于 2019-12-12 03:36:27
问题 After 2 years experience in cakePhp , recently i started learning laravel framework. i already created the database for my new project and create a default authentication system with laravel 5 using the php artisan make:auth but i cant modify it according to my database design i have a users table(id,username,password,remember_token) user_profiles table (id,first_name,last_name etc) group table(id,group_name) group_users(group_id,users_id) users_user_profiles (user_id,user_profile_id) so

codeception error after inserting laravel5 module

瘦欲@ 提交于 2019-12-12 03:36:24
问题 i have installed codeception globally. it works fine when i run codecept run functional command. when i insert laravel5 module into functional.suite.yml as per instruction from codeception website documentation, it gives me error like this. when i remove laravel5 module codecept run works normally. anyone knows how to tackle that error? should i install codeception locally instead of globally? Note : i don't use homestead/vagrant 回答1: This error doesn't seem to be related to Laravel5 module.

Laravel 5.2 - show first image from database

╄→尐↘猪︶ㄣ 提交于 2019-12-12 03:26:38
问题 I have table photos in my database where my images are stored. In one view user can see all of them, but in the other I want only one image to be seen, first one. How to set it so only the first image is displayed, not all of them? This is my code. View @foreach($business->photos as $photo) <img src="{{ url($photo->thumbnail_path) }}" class="img-thumbnail"> @endforeach ProfileController public function profile($id) { $user = User::findOrFail($id); return view('business.profile', compact('user

Route or Controller not working in Laravel 5.2

孤街醉人 提交于 2019-12-12 03:18:55
问题 At first i used a route and a controller to post status vedio link upload file comments. This is the route and controller Here is my route: Route::any('/class',[ 'uses'=> 'classroom@getclass', 'as'=>'class', ]); Here is my controller: public function getclass(Request $request) { if (Input::has('post_comment')) { $status=Input::get('post_comment'); $commentBox=Input::get('comment_text'); $selectedStatus=Status::find($status); $selectedStatus->comments()->create([ 'comment_text'=>$commentBox,

Laravel get all products from infinity nested categories

浪尽此生 提交于 2019-12-12 03:18:45
问题 I have the category model where each category can be general or nesting. Category: id parent_id title To get children of category and all nested children of category use relation with recursion public function children() { return $this->hasMany('App\Models\Category', 'parent_id', 'id'); } public function allChildren() { return $this->children()->with('allChildren'); } And relation for products public function product() { return $this->belongsToMany('App\Models\Product', 'categories_products')

Laravel 5.2 Does not show errors in register

最后都变了- 提交于 2019-12-12 03:09:15
问题 I add my routes in web middleware . When I post null value in register, it does not show me validation errors. But when I remove web middleware from my route it works correctly. Route::group(['middleware' => ['web']], function () { Route::auth(); } it does not work, but Route::auth(); works correctly Kernel.php protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware

laravel5.2 job, how to return data?

邮差的信 提交于 2019-12-12 02:59:34
问题 Job class DataFormFields extends Job implements ShouldQueue { use InteractsWithQueue, SerializesModels; protected $fieldList = [ 'name' => 'Tom', 'age' => '20', ]; public function handle() { $fields = $this->fieldList; return $fields; } } controller public function create() { $data = $this->dispatch(new DataFormFields()); return view('create', $data); } I try to dd($data); print 0 the code can work in laravel5.1 ,but in 5.2 it's not ok.help 回答1: Laravel5.2 the class will implement the

How can i display a table with two foreign keys in laravel

南笙酒味 提交于 2019-12-12 02:46:10
问题 I have 3 tables Users ------------- user_id (PK) user_name Items_distributed ------------- user_id (FK) item_id(FK) Item List ----------------- item_id(PK) item_name Now i need to print Items_distributed table by taking both the user_id and item_id and dispaly their item_name and user_name i dont know how to display both things at a time if i display either item_name or user_name its working but when i try to print both it is not working . Can any one solve my problem . This is how i print