Laravel First Program

How to create Modal . controller and index page in Laravel

================================================= Model= college.php ================================================= <!--php namespace App; use Illuminate\Database\Eloquent\Model; class College extends Model { public $name='SMSG COLLEGE'; public $pin=824211; } ================================================== Controller= CollegeController.php ================================================== namespace App\Http\Controllers; use Illuminate\Http\Request; use App\College; class CollegeController extends Controller { public function index(){ $collg= new College(); $nm = $collg--->name; $pn = $collg->pin; return view('College.index',compact('nm','pn')); } } ===================================================== Views= index.blade.php ===================================================== <!--DOCTYPE html--> <html> <head> <title>LaravelAPP</title> </head> <body> Welcome to laravel <br> {{$nm}} {{$pn}} </body> </html> ====================================================== Routes= web.php ====================================================== Auth::routes(); Route:: get('/index','CollegeController@index');

agyanadda

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 $type={blogger}:

Post a Comment