how to implement shortcodes in pages or blog?

I am using php framework laravel and I would like to implement shortcodes. Does anyone have a suggestion how to go about implementing shortcodes that could be inserted by user into a page or blog post. Example, lets say I would like to have a short...
more »

2017-01-19 22:01 (2) Answers

Laravel route not defined but it clearly is

I keep getting the following error in Laravel 5.3: Route [clients] not defined. (View: /srv/users/serverpilot/apps/project-sytem/resources/views/partials/sidebar.blade.php) (View: /srv/users/serverpilot/apps/project-sytem/resources/views/pa...
more »

2017-01-19 21:01 (1) Answers

Laravel routes don't seem to work

I'm new to Laravel. I've set up a Fedora 23 server through Oracle VirtualBox, installed composer and created a Laravel 5.3 project as the html folder (for convenience, since it's accessible by just the virtual machine's IP address). I also disabled ...
more »

2017-01-19 18:01 (3) Answers

Check if collection contains a value

I have the relationships set up (correctly i think).. I have 3 tables, users, comments, and comments' likes table. In my blade, I can access {{ $comment->commentLikes }} with this and it's returning me: [{"id":85,"comment_id":12,"user_id":1,"ac...
more »

2017-01-19 16:01 (4) Answers

Using repository inside a form request on Laravel

So I find myself creating form request to validate the request that has been posted from a form. And sometimes it gets too complex that Laravel's Validation Rules can't help, so I make another validation in the data service (which is imported in the ...
more »

2017-01-19 13:01 (1) Answers

Laravel multiple search in related tables

I have two tables related for towns and cities. (Town belongsTo City, City hasMany Town) towns table: id, name, city_id cities table: id, name For an autocomplete ajax query, i can get results by sql query like this. Select AS townid,
more »

2017-01-19 10:01 (2) Answers

Laravel, 2 projects in 2 domains same session

I'm creating 2 projects in 2 diferent domains domain1.tld and domain2.tld. The domain1.tld is the main event producer page and the domain2.tld is one of its events. I want to share the same sessions (they actually share the same database and the sa...
more »

2017-01-18 23:01 (2) Answers

Laravel bootstrap cache

I have something messed up in project. At first I didn't have debug mode even when I edited app.php to set APP_DEBUG to true. I would just get the error message that something went wrong, and that's where it ended. I could see errors in laravel.log t...
more »

2017-01-18 21:01 (0) Answers

Import assets from bower_components

I installed AdminLTE in Laravel 5.2 by Bower, but cant import assets in view. I follow step-by-step and my assets not work. app\resources\views\admin_template.blade.php <link href="{{ asset("/bower_components/AdminLTE/bootstrap/css/bootstrap....
more »

2017-01-18 14:01 (1) Answers

SendGrid category not being set

I'm redoing a project that has SendGrid integrated for mailing. Well, I'm using Laravel and Mailable classes, and I have created a function to set the SendGrid category: public function setSendgridCategory($category){ $encodedCategory = json_en...
more »

2017-01-18 13:01 (2) Answers

Laravel validation unique soft deleted

I have an input in my DB that is soft deleted and if the user tries to create a new input with same name he will get a validation error "name already exists" What is the best practice to solve this? Is it better to leave it so because maybe the sof...
more »

2017-01-18 13:01 (1) Answers

Delete row from database table with Laravel 5.2

Recently I've started with Laravel 5.2 and I'm trying to make delete button which will delete row from database. Very basic and trivial but seems I can't make it. I'm following documentation for delete: ...
more »

2017-01-18 10:01 (4) Answers

Eloquent hasOne order by before group by

I have Album model and AlbumItem model - which represents photos. In Albums model I have: public function first_photo(){ return $this->hasOne('AlbumItem')->orderBy('sort_order', 'asc'); } In the controller I load Albums list with first ...
more »

2017-01-18 09:01 (2) Answers

API - validating request in Laravel

I am creating a simple API for uploading files from mobile app. In my routes/api.php file I have a route defined: Route::post("/file", 'UploadController@upload'); then in my controller I validate the request: public function upload(Request $req...
more »

2017-01-17 21:01 (1) Answers

Laravel set route issue for post method

This is my form: <form class="form-horizontal" method="POST" action="{{ url('/categories/new') }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}"> <input class="btn btn-default" value="Cancel" type="reset"> ...
more »

2017-01-17 20:01 (2) Answers