laravel-5.2

Displaying feeds and blogs according to the created time

大憨熊 提交于 2019-12-14 03:20:55
问题 I'm having a home page where all the feeds along with comments and blogs are being displayed. Right now it is showing first all the feeds and then the blog. But I want it should be displayed according to the created time, mixer of feeds and blog not like first feed will come and then the blog. Can anyone tell me how to acheive that. This is my index.blade.php @extends('layouts/default') {{-- Page title --}} @section('title') Home @parent @stop {{-- page level styles --}} @section('header

How to serve static content in Laravel 5 over https?

江枫思渺然 提交于 2019-12-14 02:56:29
问题 I've spent a ton of time trying to fix this but haven't had any luck so far. My app isn't loading css because of a mixed content error (The page at 'https://example.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://example.com/assets/css/magazine.min.css'. This request has been blocked; the content must be served over HTTPS). I know that I can load the assets by passing in true to the asset function but that would mean I would have to go to all the asset calls and

Laravel 5.2 form validation not showing errors? [duplicate]

北战南征 提交于 2019-12-14 02:54:22
问题 This question already has answers here : ErrorBag is always empty in Laravel 5.2 (3 answers) Closed 3 years ago . My form validation is not showing any error My routes.php file is as follows: Route::post('/user/add/form', [ 'uses' => 'AdminController@adduser', 'as' => 'admin.add.user.to.database' ]); My adduser function in AdminController contains following: $this->validate($request,[ 'email'=> 'required|email', 'name'=> 'required', 'password'=> 'required', 'aright'=> 'required', 'dob' =>

Exception being thrown when trying to delete model in laravel 5.2

孤人 提交于 2019-12-14 02:52:18
问题 I have recently upgraded a Laravel 5.1 app to 5.2. This was working fine before but since the upgrade I am experiencing an issue. When I try to delete one of my models I get the following exception: FatalErrorException in Model.php line 1011: Class name must be a valid object or a string The URL I am visiting is: /admin/roles/delete/4 The route for it is: Route::get('admin/roles/delete/{id}', ['as' => 'admin.roles.delete', 'uses' => 'Admin\RolesController@destroy']); The controller code is:

Laravel 5.2 Form Validation Request

╄→尐↘猪︶ㄣ 提交于 2019-12-14 02:50:41
问题 I am currently trying to validate a 'Create Articles' form in my first Laravel application and I am having some problems. I have been following along with a tutorial that is meant for Laravel 5, however, and I am running Laravel 5.2 on this project. I have read through the documentation for Validation in Laravel 5.2 and I have asked another Laravel Developer but we just cannot seem to figure it out. CreateArticleRequest.php namespace App\Http\Requests; use App\Http\Requests\Request; class

Session variable doesn't persist during redirect in laravel

对着背影说爱祢 提交于 2019-12-14 02:38:58
问题 I am making a redirect to homecontroller after user authenticates and set a auth token to session for use in the home controller as - Controller 1 $secret = Crypt::encrypt($secret); Session::put('secret', $secret); Session::save(); return redirect()->action('loginController@homeRedirect'); Controller 2 -> homeRedirect function homeRedirect(){ dd(Session::all()); if(Session::has('secret')){ $secret = Session::get('secret'); Session::forget('secret'); Here the dump comes blank array. nothing

takes many refreshes before server side code is updated?

巧了我就是萌 提交于 2019-12-14 02:05:35
问题 I am using Bitnami WAMP Stack. Whenever I edit a php file in my IDE(I am using netbeans, have also tried phpstorm), it take 4-5 refreshes in the browser, before the page is updated. I first though that it was a cache issue in Google Chrome, but, I also tried Mozilla Firefox with history disabled. Still have the same problem. Any ideas, what could be causing this? P.S: this happens with server side code too.. eg. Controllers in Laravel. 回答1: Bitnami developer here, If you are developing on top

Laravel - displaying categories by id

倖福魔咒の 提交于 2019-12-13 21:39:17
问题 For a blog site, I have all the posts & lists of categories displaying on a page though now I need to display the posts for each category on it's own separate page. Let's say I had a categorie that was 'Javascript' and I wanted only the posts with the category of javascript displayed on a page. What's the correct code to do this? here's an example, the bold 'javascript' is what needs to be replaced with the correct code. -- categoriesController.php --- public function show($id) { $post-

Auth not persisting in Laravel 5.2

给你一囗甜甜゛ 提交于 2019-12-13 16:12:22
问题 I have my auth doing this on login. if (Auth::attempt($userdata)) { dd(Auth::user()); //this shows the user just fine, //which proves that the auth driver is working. return redirect()->intended('dashboard'); } However, after redirecting to the dashboard. It appears the auth isn't persisted. If I do dd(Auth::user()) or even just Auth::check() it returns null. Here's the route: Route::group(['middleware' => ['web']], function () { Route::get('test',function(){ dd(Auth::user()); //returns null

Show image file by id in Laravel 5.2

懵懂的女人 提交于 2019-12-13 14:49:17
问题 I have a table named files, this saves the name of the images related to the properties table. I am trying to make these images appear as in the following relation. This is part of the properties table. This is the table files and their relationship to the properties table. What parameter can I pass in the show method of my controller (PropertyController)? Currently I have the following: public function show($id) { $properties = Property::find($id); $files = File::all(); return View::make(