laravel-5.4

CSRF on YAJRA datatable Laravel5.5 not working

試著忘記壹切 提交于 2020-01-11 12:45:09
问题 I have this code where I needed to store in a variable so I display it in view, I've tried different approach of packing the "Form header" and using CSRF is not working $return = '<form method="post" action="/procurement/add-product"> '.{{ csrf_token() }}.' <input type="hidden" name= "product_id" value=".$row->id."> <input type="text" name="product_qty" class="form-control"> <button type="submit" class="btn btn-primary btn-block">Add Item</button> </form>'; return $return; Here is my route

Laravel connection MSSqL server works with cli, but not in browser

时光总嘲笑我的痴心妄想 提交于 2020-01-11 10:16:28
问题 After installing the dll's to use with MSSqL server, the command php artisan migrate ran correctly and the tables were made in the db . So I thought the connection would work for this application. I then used the command php artisan make:auth (which doesn't use the db connection) to scaffold the authentication files. Now when I try to register anyone I get errors: PDOExeption (1/2) Could not find driver and PDOExeption (2/2) Could not find driver (select count(*) from ..... Now I tried to see

Laravel connection MSSqL server works with cli, but not in browser

☆樱花仙子☆ 提交于 2020-01-11 10:16:19
问题 After installing the dll's to use with MSSqL server, the command php artisan migrate ran correctly and the tables were made in the db . So I thought the connection would work for this application. I then used the command php artisan make:auth (which doesn't use the db connection) to scaffold the authentication files. Now when I try to register anyone I get errors: PDOExeption (1/2) Could not find driver and PDOExeption (2/2) Could not find driver (select count(*) from ..... Now I tried to see

PHP7 : install ext-dom issue

馋奶兔 提交于 2020-01-09 00:47:43
问题 I'm running laravel 5.4 on Ubuntu 16.04 server with PHP7. trying to install cviebrock/eloquent-sluggable package throw some error: pish@let:/home/sherk/ftp/www$ sudo composer require cviebrock/eloquent-sluggable Do not run Composer as root/super user! See https://getcomposer.org/root for details Using version ^4.2 for cviebrock/eloquent-sluggable ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your

Change of baseUrl for PHPUnit in Laravel 5.4

删除回忆录丶 提交于 2020-01-06 06:55:10
问题 It seems that before Laravel 5.4 we could change the URL for testing by coding like this: protected $baseUrl = 'http://someurl.com'; But now it is not working and some suggest we have to use this method function setUp() { parent::setUp(); config(['app.url' => 'http://yourcustomeaddress.loc']); } Would anybody help me and tell Where I should put this method? 回答1: You may put it in tests/TestCase.php (Laravel 5.4 example): abstract class TestCase extends BaseTestCase { function setUp() { parent

Trying to get property of non-object (View: C:\xampp\htdocs\travel\resources\views\user\profile.blade.php)

久未见 提交于 2020-01-06 06:07:36
问题 before all that it was working perfectly fine but after i've updated the profile it began to show the error where there's only div present.profile.blade and the error is error 回答1: Instead of {{ $users->photo_id->file }} you should probably use: {{ $users->photo->file }} PS. And next time please put code into question and not put links to screenshots only. 来源: https://stackoverflow.com/questions/46673286/trying-to-get-property-of-non-object-view-c-xampp-htdocs-travel-resources-vie

Show Product Name in Laravel Model Relationship

冷暖自知 提交于 2020-01-06 06:03:43
问题 Can you help me again? I have 3 tables Product Table id product_name Productquantity Table id item_id price Orders id req_id quantity_id quantity amount How can I get the product name in my CartView? I only have this in my code Order Model public function product() { return $this->belongsTO('App\Productquantity', 'item_id', 'id'); } My Controller $dataReqorder = Reqorder::where('req_id','=', $shoppingId)->with('product')->get(); My View @foreach($dataReqorder as $order) <tr class="item{{

laravel - fails to redirect multiple authentication to different pages

∥☆過路亽.° 提交于 2020-01-06 05:34:19
问题 I use laravel 5.4 and I want to redirect these three different types of users to different pages Schema Types +-------+-------------+ | id | name | +-------+-------------+ | 1 | Super Admin | | 2 | Admin | | 3 | Cashier | +-------+-------------+ Users +-------+---------+-------------+ | id | type_id | name | +-------+---------+-------------+ | 1 | 1 | Super Admin | | 2 | 2 | Admin | | 3 | 3 | Cashier | +-------+---------+-------------+ LoginController public function redirectTo() { if (Auth:

how can I use exists column with laravel model

本秂侑毒 提交于 2020-01-05 07:50:13
问题 I have a column in my database called exists , but when I try to use $model->exists Laravel checks if the record exists rater return the value of exists. Is their any way to tell Laravel not to do this on that particular model? 回答1: As suggested earlier, renaming your column would be a good idea, because it's a reserved keyword in most database servers. To answer your question though, you can use $model->getAttribute('exists') to get the value of a model attribute. Source 回答2: There's another

How to use pagination along with laravel eloquent find method in laravel 5.4

倖福魔咒の 提交于 2020-01-05 06:26:47
问题 I am trying to implement pagination in laravel and got following error Undefined property: Illuminate\Pagination\LengthAwarePaginator::$name Here is my controller function public function showTags($id) { $tag = Tag::find($id)->paginate(5); // when lazy loading $tag->load(['posts' => function ($q) { $q->orderBy('id', 'desc'); }]); return view('blog.showtags')->withTag($tag); } Here is the Tag Model class Tag extends Model { public function posts() { return $this->belongsToMany('App\Post'); } }