×
Clear all filters including search bar
Valeri Tandilashvili's Laravel Notes
APP_ENV=local
APP_DEBUG=true
Test environment settings:APP_ENV=testing
APP_DEBUG=true
Production environment settings:APP_ENV=production
APP_DEBUG=false
The main difference is that errors are not shown on production, also prevention mechanisms from deleting DB data using migration toolstinyInteger
method generates tinyint(4)
data type in MySQL$table->tinyInteger('column_name');
Whereas boolean
method generates tinyint(1)
data type$table->$table->boolean('column_name');
JS
is to use !!
directives:<script>
change_asset_category('{!! $category_values !!}');
</script>
The result will be:<script>
change_asset_category('{"version":"vers","patch_level":"patc","bcp_dr":"bcp\/d"}');
</script>
APP_KEY
value in our .env file
for security purposes (for sessions and other encrypted data)php artisan key:generate
public function __construct() {
$this->middleware('auth', ['except'=>['index', 'show']]);
}
public function edit($id)
{
$post = POST::find($id);
// Check for correct user
if (auth()->user()->id !== $post->user_id) {
return redirect('/posts')->with('error', 'Unauthorized page');
}
return view('posts.edit')->with('post', $post);
}
package.json
like bootstrap, jquery, popper.js, vue
(removes frontend scaffolding)php artisan preset none
Except the following packages"devDependencies": {
"axios": "^0.19",
"cross-env": "^7.0",
"laravel-mix": "^5.0.1",
"lodash": "^4.17.19",
"resolve-url-loader": "^3.1.0",
"sass": "^1.15.2",
"sass-loader": "^8.0.0"
}
php artisan
public function destroy($id)
{
$post = POST::find($id);
$post->delete();
return redirect('/posts')->with('success', 'Post Removed');
}
ckeditor
we should use {!!$post->body!!}
instead of {{$post->body}}