php MVC framework like laravel but simpler
public\
App\Http\Controllers
app\
recources\view\
config\database.php
change the values base on your database setting:
return [
'DBHOST' => 'localhost',
'DBPASSWORD' => '',
'DBUSERNAME' => 'root',
'DBNAME' => 'dbname'
];
Blade is a simple, yet powerful templating engine provided with Laravel. Unlike controller layouts, Blade is driven by template inheritance and sections. All Blade templates should use the .blade.php extension.
Defining A Blade Layout
<html>
<head>
<title>App Name - @yield('title')</title>
</head>
<body>
@section('sidebar')
This is the master sidebar.
@endsection
<div class="container">
@yield('content')
</div>
</body>
</html>
@extends('layouts.master')
@section('sidebar')
<p>This is appended to the master sidebar.</p>
@endsection
@section('content')
<p>This is my body content.</p>
@endsection
You can register the routes in : routes / web.php
Route::get("url", "controller@method", "name");
For Example :
Route::get("", "HomeController@index", "index");
Route::get("create", "HomeController@create", "create");
Route::post("store", "HomeController@store", "store");
Route::get("edit/{id}", "HomeController@edit", "edit");
Route::put("/update/{id}", "HomeController@update", "update");
Route::delete("/delete/{id}", "HomeController@destroy", "delete");
The route function generates a URL for a given named route:
$url = route('route.name');
If the route accepts parameters, you may pass them as the second argument to the function:
$url = route('route.name', ['id' =>1]);
The asset function generates a URL for an asset using the current scheme of the request (HTTP or HTTPS):
$url = asset('img/photo.jpg');
The view function load a view instance that exists in resources/view:
return view('auth.login');
The old function retrieves an old input value flashed into the session:
$value = old('name');
return The current url :
$url = currentUrl();
return the current domain base on http:// and https:// protocol:
$url = currentDomain();
\System\Auth\Auth::user()
retrun currently authenticated user
\System\Auth\Auth::user()->first_name;
To determine if the user making the incoming HTTP request is authenticated, you may use the check method on the Auth facade. This method will return true if the user is authenticated:
use App\Http\Controllers\Controller;
if (Auth::check()) {
// The user is logged in...
}
To log a user into the application by their ID, you may use the loginById method. This method accepts the primary key of the user you wish to authenticate:
Auth::loginById(1);
@section('script')
<script src="<?= asset('ckeditor/ckeditor.js') ?>"></script>
<script type="text/javascript">
CKEDITOR.replace( 'body', {
filebrowserBrowseUrl: '/ckfinder/ckfinder.html',
filebrowserUploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
} );
</script>
@endsection