Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel fillable

    /**
     * The attributes that are mass assignable.
     */
    protected $fillable = [
      					   'title',
                           'slug',
                           'body',
                           'image',
                           'published',
                           'comments_open'
                          ];
Comment

fillable in laravel

//for comment Section

//commentController.php
    public function store(StoreCommentRequest $request)
    {
        //
        $comment = Comment::create([
            "message"=>$request->message,
            "post_id"=>$request->post_id,
            "user_id"=>Auth::id(),
        ]);
        return redirect()->to(url()->previous()."#comment-create");    
    }

//Comment.php <= model

    class Comment extends Model
    {
    use HasFactory;

    protected $fillable =["message","user_id","post_id"];
    }

Comment

PREVIOUS NEXT
Code Example
Php :: laravel blade date format 
Php :: find string in text in laravel 
Php :: Google_Service_Calendar Event Date Time 
Php :: php right characters 
Php :: php check if variable is int 
Php :: return json response id name from eloquent all laravel 
Php :: php add year to date 
Php :: laravel singular 
Php :: php array to js 
Php :: symfony exclude class from autowiring 
Php :: php get date using timezone 
Php :: laravel pagination publish command 
Php :: php get number from string 
Php :: php shorthand if isset 
Php :: override Telescope in laravel 
Php :: have_rows count acf php 
Php :: laravel create model with migration and controller 
Php :: PHP Forward POST content into Python script 
Php :: login with email or phone number laravel 
Php :: laravel blade auth check 
Php :: teruglopende for loop php 
Php :: laravel display validation errors ajax 
Php :: change php version in ubuntu 
Php :: echo post content by slug 
Php :: php client enable short tags 
Php :: how check if method is not in class in php 
Php :: count in string php 
Php :: Message: Too few arguments to function Admin::tindakan_vaksin1(), 1 passed in C:xampphtdocsloginsystemcoreCodeIgniter.php on line 532 and exactly 2 expected 
Php :: get image size php 
Php :: php get php.ini location from termina 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =