I have simply followed Laravel documentation for setting up Vue.js
When the build is ready, add app.js from the public folder to your blade.php page’s footer
If you are getting an error saying the components not found, it means your script is executing before the document is ready
Make sure you have added app.js script at the end of the page
Adding new component (similar to ‘example’ component given with Laravel):
Components are one of the most powerful features of Vue. They help you extend basic HTML elements to encapsulate reusable code. At a high level, components are custom elements that Vue’s compiler attaches behavior to. In some cases, they may also appear as a native HTML element extended with the special is attribute.
Create a new component in resources/components called Greeting.vue
Add your bootstrap element inside template element
Create an instance of ‘greeting’ component in app.js
Middleware provides convenient mechanism for HTTP requests entering your application. For example, Laravel includes a middleware that verifies the user of your application is authenticated. If the user is not authenticated, the middleware will redirect the user to the login screen. However, if the user is authenticated, the middleware will allow the request to proceed further into the application.
Laravel includes a simple method of seeding your database with test data using seed classes. All seed classes are stored in database/seeds. Seed classes may have any name you wish, but probably should follow some sensible convention, such as UsersTableSeeder, etc.
Adding some data to the tables for viewing something on the browser
Use “php artisan make:seeder UsersTableSeeder”
Add insert statements in the run method
DB::table(‘words’)->insert([ ‘word’=>’Modest’, ‘meaning’=>’Refusing to take any credit’, ‘language’=>’English’ ]);
Fixing mass assignment exception by addin – protected $guarded = ; to model “user.php” in app folder
You can start adding users
Note – If the primary key is not ‘id’ for a table it won’t update. You’ll have to change the the primary key in your model (Eloquent ORM (Object Reference Model)). Eg -> protected $primarykey=’userid’;
CRUD operations done
These are the messages that can be shown after a successful request
Things to do:
How to remove /public/app etc and make it /app without giving access to .env file?
How to add bootstrap & styling?
How to add JS if required?
How to move this localhost built app to a new server?
1) Created database for Laravel, you can see the options in for various database servers on config.php
2) Use any database server and set the parameters on config/database.php and also on the ‘env’ file on the root directory
3) for installing migration “php artisan migrate:install”
4) migrate table gets created
5) to make a migration “php artisan make:migration create_authors_table”
6) on successful creation open migrations, open the created migration
7) create schema in ‘up’ function of the class, drop schema in ‘down’ function
8) Schema query builder is used for creating tables
9) run migrations by using “php artisan migrate”
10) fluent query builder is used for inserting & updating tables
11) DB:: for crud operation into table
12) php artisan migrate:rollback for executing ‘down’ in the migrations (1 step at a time)
13) php artisan migrate:reset for executing ‘down’ on all migrations at once