Posts

Showing posts with the label laravel-5

htmlspecialchars() expects parameter 1 to be string, object given

Image
Clash Royale CLAN TAG #URR8PPP htmlspecialchars() expects parameter 1 to be string, object given This is Controller. I named it CartController <?php namespace AppHttpControllers; use IlluminateHttpRequest; use GloudemansShoppingcartFacadesCart; use AppProduct; class CartController extends Controller { public function index() { $cartItems=Cart::content(); return view('cart.index', compact('cartItems')); } public function edit($id) { $product=Product::find($id); Cart::add($id,$product->name,'1',$product->price); } This is my welcome.blade.php. This is the page where I display all my Items. <div class="row"> @forelse($books->chunk(4) as $chunk) @foreach($chunk as $book) <div class="column-prod"> <a href="{{url('view')}}"> <div class="card-prod"> <center><img src="{{url('images',$book->image)}}" style="width: 300px; height: 30...

Laravel/Guzzle Issue

Image
Clash Royale CLAN TAG #URR8PPP Laravel/Guzzle Issue Hello guys i have an issue when trying to use guzzle in laravel and i have spent ages trying to google it and research what the problem could be. This is a very simple get request for WHM/Cpanel api $client = new Client(); $res = $client->request('GET', 'https://delta.cloudns.io:2087/json-api/accountsummary…', [ 'auth' => [ 'username','passowrd'] ]); Now i get a 200 status for the request but i am not getting any data back and in the network tab on firefox/chrome tools the page is showing as a error 500. The code above i put into the index of my controller. I have tested the username and password and url in postman and it works correctly and i get back the data i expect. Any help would greatly appreciated. Thanks The typo in passowrd has nothing to do with it has it? – WebCode.ie 26 mins ago ...

Laravel 5.6 - webpack: Uncaught ReferenceError: jQuery is not defined

Image
Clash Royale CLAN TAG #URR8PPP Laravel 5.6 - webpack: Uncaught ReferenceError: jQuery is not defined I got package.json: "devDependencies": { "axios": "^0.18.0", "bootstrap": "^4.1.3", "bootstrap-datepicker": "^1.7.1", "browser-sync": "^2.24.6", "browser-sync-webpack-plugin": "^2.0.1", "chart.js": "^2.7.2", "cross-env": "^5.2.0", "datatables": "^1.10.18", "easy-pie-chart": "^2.1.7", "font-awesome": "4.7.0", "fullcalendar": "^3.9.0", "jquery": "^3.3.1", "jquery-sparkline": "^2.4.0", "jvectormap": "^2.0.4", "laravel-mix": "^2.1.11", "load-google-maps-api": "^1.2.0", "lodash": "^4....

How to transform an existing column in foreign key using Laravel Migrations

Image
Clash Royale CLAN TAG #URR8PPP How to transform an existing column in foreign key using Laravel Migrations i'm having trouble trying to change a column type in laravel to fits it as a compatible column to be a foreign key referencing another table id fields. Actualy i have a a schema like this: Schema::create('person_organization', function(Blueprint $table){ ... $table->integer('organization_id'); ... }); and i want to change the field organization_id to an unsigned type, wich will make it able to be a foreign key referencing the id field in the organizations table. organization_id id organizations NOTE: Just changing the field type in the creation of the table is not an available option, because the system is running in production mode. So we need to make a new migration to do these changes. NOTE 2: i tried the method change as described in laravel docs, but it stucks in a query error, as following: change IlluminateDatabaseQueryException : ...

Laravel 5.6 Auth /admin showing blank page with or without login

Image
Clash Royale CLAN TAG #URR8PPP Laravel 5.6 Auth /admin showing blank page with or without login I am new to Laravel and its 5.6 version. I setup a Auth login using few commands over there. All is good going. But when I uploaded to my own live server then when I run site.com/admin [that should be redirect to site.com/login for non login scene]. But I got a blank page. When I ran site.com.login then login page is working and I am in admin panel to work on. My question is that why my site.com/admin page is blank. all other pages are working fine. here is my files. routes/web.php Route::get('/', 'HomeController@index')->name('home');; Route::get('view/{slug?}', 'HomeController@view'); Auth::routes(); Route::prefix('admin')->group(function () { Route::get('/', 'AdminAdminController@admin_index')->name('admin_index'); Route::get('/dashboard', 'AdminAdminController@dashboard')->name(...