so I have created my own blog package in a structure of Packages/Sitemanager/Blog I have a service provider that looks like the following: Now, what i would like to do is run the migrations dynamically if they have never been run before or within an installation process i suppose. I’ve seen in older doc…
Tag: laravel
Laravel 5 On POST Status 302 Found
I’m trying to create new post useing laravel , ajax and s3 , But every time i try submit the form i get Status Code:302 Found , I Hope really some help me Firebug Here in firebug result image META …
laravel 5.2 cant pass variable to view
I have a very simple controller and view. But for some reason I am unable to pass a variable to my view. Note that echo $project->title inside the router works. Controller: } View: But for some reason I keep getting this error: ErrorException in b605b028d5285b79f4e0043cf14415de5dddcae6.php line 10: Undefin…
How to update laravel project after changing javascript file and controller
I added a .blade.php file and modified a controller and javascript file in my laravel project. I’m unable to see the changed on the server(localhost). Is there a command to update/refresh the project ?…
Laravel 5 php artisan migrate –database parameter not working
i want to migrate database using console command when i try php artisan migrate is working, but when i try php artisan migrate –database=”test” is not working it said [InvalidArgumentException] …
Alias for a route with a fixed parameter value
I have this route: Route::get(‘/MyModel/{id}’, ‘MyController@show’); The method show() accepts a parameter called id and I want to setup an alias for /MyModel/1 so it’s accesible from /MyCustomURL. …
Type hinting for the model objects of Eloquent ORM
I haven’t used laravel yet, but watching the tutorials on youtube left me with a question to type hinting, that is really important to me. Now I have read here Type Hinting Eloquent Models and here Eloquent ORM Code Hinting in PhpStorm but neither addresses the following problem: now lets say movie has …
BadMethodCallException with message ‘Call to undefined method IlluminateDatabaseQueryBuilder::toArray()’
I am working along with @Jeffrey_way series of Laracasts Many to Many Relations (With Tags) Below is the code I have written in CMD using Laravel Tinker: After executing the last line of code ($article->tags()->toArray(); Although everything seems to be OK with my code but still I get following error: A…
Laravel 5.2 – Selecting only articles that has comments
I built a commenting system, and I’m working on a page that shows all the comments that are waiting for approval. The relationship: Article.php public function comments() { return $this->…
Laravel Database Schema, Nullable Foreign
I’ve these two database tables: User Tables Partner Tables User Tables will handle this kind of informations While Partner Tables will contains all the user meta information such as first name and last name, etc. When a user is register to the site I only want few fields which are, username, email addre…