Laravel Tutorials
- What is laravel
- Laravel Installation
- Directory Structure
- htaccess
- Remove public from url
- Artisan Command
- Laravel Configuration
- Routing Configuration
- Namespaces
- Request
- Response
- Controller
- Model
- User Authentication
- Multi User Authentication
- Database Seeding
- Database
- Database Query
- ORM
- One-to-One Relationship
- One-to-Many Relationship
- Many to Many Eloquent Relationship
- Has One Through
- Has Many Through
- Querying Relations
- Middleware
- Laravel Views
- Blade Views
- Print data on view page
- Get Site URL
- Get URL Segment
- Get images from Storage folder
- Clear cache
- Form Class not found
- Flash Message in laravel
- Redirections
- path
- CRUD Projerct
- CRUD in Laravel
- CRUD progran
- Laravel Validation
- Jquery Validation
- Cookie
- Session
- Email Send in laravel
- File uploading
- CSRF Protection
- Helper in Laravel
- Helper Functions
- Guzzle Http Client
- Paypal Payment Gatway Integration
- Cron Job in laravel
- Flash message
- path
- Errors Handling
- Date Format
- Date Format Validation
- Display Image on View Page
- Update User Status using toggle button
- Delete Multiple Records using Checkbox in Laravel?
- Confirmation Before Delete Record
- Delete image from storage
- Remove/Trim Empty & Whitespace From Input Requests
- Block IP Addresses from Accessing Website
- How to Disable New User Registration in Laravel
- Redirect HTTP To HTTPS Using Laravel Middleware
- CKEditor
- slug generate unique
- Prevent Browser's Back Button After Logout
- Datatable dunamically
- encrypt & Decript
- Download File
- Rest API
- Shopping Cart
- Shopping Cart Example
- Dynamic Category-Subcategory Menu
- Ajax Search
- Interview Question
- laravel Tutorilal link
- laravel Tutorilal
Important Links
Call to undefined function str_slug()
So basically, you can not use string and array helpers in laravel 6. laravel 6 removed helpers function. You can use Illuminate\Support\Str and Illuminate\Support\Arr classes for helpers. so you can use all helpers function
Solution 1:
File name : index.php
Route::get('/', function () {
$newSlug = Str::slug('I am from itechxpert.in');
dd($newSlug);
});
Solution 2:
you want to use helpers functions then you need to install new composer package with following command:
File name : index.php
composer require laravel/helpers
Route::get('/', function () {
$newSlug = str_slug('I am from itechxpert.in');
dd($newSlug);
});
You can use Helpers like this way:
Arr::add
Arr::collapse
Arr::divide
Arr::dot
Arr::except
Arr::first
Arr::flatten
Arr::forget
Arr::get
Arr::has
Arr::last
Arr::only
Arr::pluck
Arr::prepend
Arr::pull
Arr::random
Arr::set
Arr::sort
Arr::sortRecursive
Arr::where
Arr::wrap
Str::after
Str::before
Str::camel
Str::contains
Str::containsAll
Str::endsWith
Str::finish
Str::is
Str::kebab
Str::limit
Str::orderedUuid
Str::plural
Str::random
Str::replaceArray
Str::replaceFirst
Str::replaceLast
Str::singular
Str::slug
Str::snake
Str::start
Str::startsWith
Str::studly
Str::title
Str::uuid
Str::words
How to get keys name from array using array helper
$myArray = [
'name'=>'Nusrat Bano',
'email'=>'itechxpert@gmail.com',
'website'=>'itechxpert.com'
];
$myArrayKey = array_keys($myArray);
dd($myArrayKey);
How to Get Logged in User Data
Get Logged User Data using helper
you can get login user details using auth() helper, it will return object of users details.
File name : index.php
$user = auth()->user();
print_r($user);
Get Logged User ID using helper
File name : index.php
$id = auth()->user()->id;
print_r($id);
Get Logged User Data using facade
File name : index.php
$user = Auth::user();
print_r($user);
Get Logged User ID using facade
File name : index.php
$id = Auth::user()->id;
print_r($id);
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php
File name : index.php